Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(807)

Unified Diff: base/synchronization/read_write_lock.h

Issue 2692273008: Hacky slashy (Closed)
Patch Set: wip Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/synchronization/read_write_lock.h
diff --git a/base/synchronization/read_write_lock.h b/base/synchronization/read_write_lock.h
index 4c59b7b1168f18b3ee1281c8184c76d5855656da..98fb488aa731c26332b02954748e2f1662785b23 100644
--- a/base/synchronization/read_write_lock.h
+++ b/base/synchronization/read_write_lock.h
@@ -9,7 +9,7 @@
#include "base/macros.h"
#include "build/build_config.h"
-#if defined(OS_NACL)
+#if defined(OS_NACL) || defined(OS_FUCHSIA)
#include "base/synchronization/lock.h"
#endif
@@ -17,6 +17,8 @@
#include <windows.h>
#elif defined(OS_POSIX)
#include <pthread.h>
+#elif defined(OS_FUCHSIA)
+#include <threads.h>
#else
# error No reader-writer lock defined for this platform.
#endif
@@ -51,11 +53,13 @@ class BASE_EXPORT ReadWriteLock {
using NativeHandle = Lock;
#elif defined(OS_POSIX)
using NativeHandle = pthread_rwlock_t;
+#elif defined(OS_FUCHSIA)
+ using NativeHandle = Lock;
#endif
NativeHandle native_handle_;
-#if defined(OS_NACL)
+#if defined(OS_NACL) || defined(OS_FUCHSIA)
// Even though NaCl has a pthread_rwlock implementation, the build rules don't
// make it universally available. So instead, implement a slower and trivial
// reader-writer lock using a regular mutex.

Powered by Google App Engine
This is Rietveld 408576698