summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/shared_memory_posix.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/shared_memory_posix.cc b/base/shared_memory_posix.cc
index 7283cbd..dfd86aa 100644
--- a/base/shared_memory_posix.cc
+++ b/base/shared_memory_posix.cc
@@ -292,6 +292,7 @@ void SharedMemory::Close() {
void SharedMemory::LockOrUnlockCommon(int function) {
DCHECK(mapped_file_ >= 0);
+#if !defined(ANDROID)
while (lockf(mapped_file_, function, 0) < 0) {
if (errno == EINTR) {
continue;
@@ -307,14 +308,19 @@ void SharedMemory::LockOrUnlockCommon(int function) {
<< " msg:" << safe_strerror(errno);
}
}
+#endif
}
void SharedMemory::Lock() {
+#if !defined(ANDROID)
LockOrUnlockCommon(F_LOCK);
+#endif
}
void SharedMemory::Unlock() {
+#if !defined(ANDROID)
LockOrUnlockCommon(F_ULOCK);
+#endif
}
SharedMemoryHandle SharedMemory::handle() const {