| Index: base/shared_memory_posix.cc
|
| diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
|
| index 32a55e91284f21d5abc299e376dd81192f668d4e..575089b6b69c91783267bbcaf667de42d49ff5cf 100644
|
| --- a/base/shared_memory_posix.cc
|
| +++ b/base/shared_memory_posix.cc
|
| @@ -11,9 +11,11 @@
|
| #include <unistd.h>
|
|
|
| #include "base/file_util.h"
|
| +#include "base/lazy_instance.h"
|
| #include "base/logging.h"
|
| #include "base/threading/platform_thread.h"
|
| #include "base/safe_strerror_posix.h"
|
| +#include "base/synchronization/lock.h"
|
| #include "base/threading/thread_restrictions.h"
|
| #include "base/utf_string_conversions.h"
|
|
|
| @@ -34,6 +36,8 @@ namespace {
|
| // namespaces, but who knows what's out there.
|
| const char kSemaphoreSuffix[] = "-sem";
|
|
|
| +LazyInstance<Lock>::Leaky g_thread_lock_ = LAZY_INSTANCE_INITIALIZER;
|
| +
|
| }
|
|
|
| SharedMemory::SharedMemory()
|
| @@ -268,11 +272,13 @@ void SharedMemory::Close() {
|
| }
|
|
|
| void SharedMemory::Lock() {
|
| + g_thread_lock_.Get().Acquire();
|
| LockOrUnlockCommon(F_LOCK);
|
| }
|
|
|
| void SharedMemory::Unlock() {
|
| LockOrUnlockCommon(F_ULOCK);
|
| + g_thread_lock_.Get().Release();
|
| }
|
|
|
| #if !defined(OS_ANDROID)
|
|
|