| Index: base/memory/shared_memory_posix.cc
|
| diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc
|
| index 35d746e5394e0e042bbaac33421d94c8406e65e2..8aaa9ce443890f64140c06cb9e0a4b410bdf711d 100644
|
| --- a/base/memory/shared_memory_posix.cc
|
| +++ b/base/memory/shared_memory_posix.cc
|
| @@ -4,16 +4,13 @@
|
|
|
| #include "base/memory/shared_memory.h"
|
|
|
| -#include <errno.h>
|
| #include <fcntl.h>
|
| #include <sys/mman.h>
|
| #include <sys/stat.h>
|
| -#include <sys/types.h>
|
| #include <unistd.h>
|
|
|
| #include "base/files/file_util.h"
|
| #include "base/files/scoped_file.h"
|
| -#include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/posix/eintr_wrapper.h"
|
| #include "base/posix/safe_strerror.h"
|
| @@ -21,9 +18,6 @@
|
| #include "base/profiler/scoped_tracker.h"
|
| #include "base/scoped_generic.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| -#include "base/synchronization/lock.h"
|
| -#include "base/threading/platform_thread.h"
|
| -#include "base/threading/thread_restrictions.h"
|
|
|
| #if defined(OS_MACOSX)
|
| #include "base/mac/foundation_util.h"
|
| @@ -38,8 +32,6 @@ namespace base {
|
|
|
| namespace {
|
|
|
| -LazyInstance<Lock>::Leaky g_thread_lock_ = LAZY_INSTANCE_INITIALIZER;
|
| -
|
| struct ScopedPathUnlinkerTraits {
|
| static FilePath* InvalidValue() { return nullptr; }
|
|
|
| @@ -414,16 +406,6 @@ void SharedMemory::Close() {
|
| }
|
| }
|
|
|
| -void SharedMemory::LockDeprecated() {
|
| - g_thread_lock_.Get().Acquire();
|
| - LockOrUnlockCommon(F_LOCK);
|
| -}
|
| -
|
| -void SharedMemory::UnlockDeprecated() {
|
| - LockOrUnlockCommon(F_ULOCK);
|
| - g_thread_lock_.Get().Release();
|
| -}
|
| -
|
| #if !defined(OS_ANDROID)
|
| bool SharedMemory::PrepareMapFile(ScopedFILE fp, ScopedFD readonly_fd) {
|
| DCHECK_EQ(-1, mapped_file_);
|
| @@ -491,25 +473,6 @@ bool SharedMemory::FilePathForMemoryName(const std::string& mem_name,
|
| }
|
| #endif // !defined(OS_ANDROID)
|
|
|
| -void SharedMemory::LockOrUnlockCommon(int function) {
|
| - DCHECK_GE(mapped_file_, 0);
|
| - while (lockf(mapped_file_, function, 0) < 0) {
|
| - if (errno == EINTR) {
|
| - continue;
|
| - } else if (errno == ENOLCK) {
|
| - // temporary kernel resource exaustion
|
| - base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(500));
|
| - continue;
|
| - } else {
|
| - NOTREACHED() << "lockf() failed."
|
| - << " function:" << function
|
| - << " fd:" << mapped_file_
|
| - << " errno:" << errno
|
| - << " msg:" << base::safe_strerror(errno);
|
| - }
|
| - }
|
| -}
|
| -
|
| bool SharedMemory::ShareToProcessCommon(ProcessHandle process,
|
| SharedMemoryHandle* new_handle,
|
| bool close_self,
|
|
|