projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wfstack: header implementation should be defined as static inline
[urcu.git]
/
urcu
/
static
/
urcu.h
diff --git
a/urcu/static/urcu.h
b/urcu/static/urcu.h
index 777fa4c593b17ee2625c23c143e6ee668e8f9e40..0295a3e5183cc57315e8488a03a70d0023286d51 100644
(file)
--- a/
urcu/static/urcu.h
+++ b/
urcu/static/urcu.h
@@
-31,7
+31,6
@@
#include <stdlib.h>
#include <pthread.h>
#include <stdlib.h>
#include <pthread.h>
-#include <syscall.h>
#include <unistd.h>
#include <stdint.h>
#include <unistd.h>
#include <stdint.h>
@@
-51,9
+50,17
@@
extern "C" {
#define RCU_MEMBARRIER
#endif
#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
#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
/* If the headers do not support SYS_membarrier, statically use RCU_MB */
#ifdef SYS_membarrier
@@
-144,7
+151,7
@@
static inline void debug_yield_write(void)
static inline void debug_yield_init(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)
}
#else
static inline void debug_yield_read(void)
This page took
0.024373 seconds
and
4
git commands to generate.