From: Michael Lee Date: Tue, 19 Jul 2016 20:26:37 +0000 (-0700) Subject: Fix macro check in SysMembarrier X-Git-Tag: 2016.07.26~30 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7dd33144a64c45dfce872842679f7cba71f64c98;p=folly.git Fix macro check in SysMembarrier 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 --- diff --git a/folly/portability/SysMembarrier.cpp b/folly/portability/SysMembarrier.cpp index 923bece7..16fa5fb0 100644 --- a/folly/portability/SysMembarrier.cpp +++ b/folly/portability/SysMembarrier.cpp @@ -21,7 +21,7 @@ #include #include -#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