pthread_self should be cast to unsigned long
[urcu.git] / urcu / static / urcu.h
index 777fa4c593b17ee2625c23c143e6ee668e8f9e40..f2293bca5054db275cd52e413a2e954ecd60af86 100644 (file)
@@ -31,7 +31,6 @@
 
 #include <stdlib.h>
 #include <pthread.h>
-#include <syscall.h>
 #include <unistd.h>
 #include <stdint.h>
 
 extern "C" {
 #endif 
 
-/* Default is RCU_MEMBARRIER */
+/* Default is RCU_MEMBARRIER on linux */
 #if !defined(RCU_MEMBARRIER) && !defined(RCU_MB) && !defined(RCU_SIGNAL)
-#define RCU_MEMBARRIER
+# ifdef __linux__
+# define RCU_MEMBARRIER
+# else
+# define RCU_MB
+# endif
 #endif
 
 #ifdef RCU_MEMBARRIER
-#include <unistd.h>
-#include <sys/syscall.h>
+#include <syscall.h>
 
 /* If the headers do not support SYS_membarrier, statically use RCU_MB */
 #ifdef SYS_membarrier
@@ -144,7 +146,7 @@ static inline void debug_yield_write(void)
 
 static inline void debug_yield_init(void)
 {
-       rand_yield = time(NULL) ^ pthread_self();
+       rand_yield = time(NULL) ^ (unsigned long) pthread_self();
 }
 #else
 static inline void debug_yield_read(void)
This page took 0.023441 seconds and 4 git commands to generate.