X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Fstatic%2Furcu.h;h=0295a3e5183cc57315e8488a03a70d0023286d51;hb=bc2433a9853a945a825c244e9ccfe341b73b2ceb;hp=289827248c8405aa41918b6b7619dc80f0bd7489;hpb=a2e7bf9ce5de5113c7f59c380b0087e291cd603d;p=urcu.git diff --git a/urcu/static/urcu.h b/urcu/static/urcu.h index 2898272..0295a3e 100644 --- a/urcu/static/urcu.h +++ b/urcu/static/urcu.h @@ -31,15 +31,15 @@ #include #include -#include #include +#include #include #include #include #include #include -#include +#include #ifdef __cplusplus extern "C" { @@ -50,9 +50,17 @@ extern "C" { #define RCU_MEMBARRIER #endif +/* + * RCU_MEMBARRIER is only possibly available on Linux. Fallback to RCU_MB + * otherwise. + */ +#if !defined(__linux__) && defined(RCU_MEMBARRIER) +#undef RCU_MEMBARRIER +#define RCU_MB +#endif + #ifdef RCU_MEMBARRIER -#include -#include +#include /* If the headers do not support SYS_membarrier, statically use RCU_MB */ #ifdef SYS_membarrier @@ -143,7 +151,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) @@ -228,7 +236,7 @@ struct rcu_reader { extern struct rcu_reader __thread rcu_reader; -extern int gp_futex; +extern int32_t gp_futex; /* * Wake-up waiting synchronize_rcu(). Called from many concurrent threads.