Fix macro check in SysMembarrier
authorMichael Lee <mzlee@fb.com>
Tue, 19 Jul 2016 20:26:37 +0000 (13:26 -0700)
committerFacebook Github Bot 4 <facebook-github-bot-4-bot@fb.com>
Tue, 19 Jul 2016 20:38:24 +0000 (13:38 -0700)
Summary:
FOLLY_X64 is usually defined, so check whehter it is defined
to 0 or 1.  In addition, memory barriers are not necessarily widely
available on the mobile platforms. What leads me to believe this is
that, at least for older ndk's, atomics are not guaranteed to work for
multicore platforms.

Reviewed By: andriigrynenko

Differential Revision: D3586806

fbshipit-source-id: 3ac8c4b74cac09e41bc3cb65c8adc2732b8b2256

folly/portability/SysMembarrier.cpp

index 923bece77f09f88c70ea7eb85acef7dc5259ab70..16fa5fb0770f5268a755b7c657e215fca570958a 100644 (file)
@@ -21,7 +21,7 @@
 #include <folly/Portability.h>
 #include <folly/portability/Unistd.h>
 
-#if !defined(__NR_membarrier) && defined(FOLLY_X64)
+#if !defined(__NR_membarrier) && FOLLY_X64 && !FOLLY_MOBILE
 #define __NR_membarrier 324
 #define MEMBARRIER_CMD_QUERY 0
 #define MEMBARRIER_CMD_SHARED 1