… | |
… | |
113 | * the ECB_MEMORY_FENCE operations for your cpu/compiler |
113 | * the ECB_MEMORY_FENCE operations for your cpu/compiler |
114 | * OR provide pthread.h and link against the posix thread library |
114 | * OR provide pthread.h and link against the posix thread library |
115 | * of your system. |
115 | * of your system. |
116 | */ |
116 | */ |
117 | #include <pthread.h> |
117 | #include <pthread.h> |
|
|
118 | #define ECB_NEEDS_PTHREADS 1 |
|
|
119 | #define ECB_MEMORY_FENCE_NEEDS_PTHREADS 1 |
118 | |
120 | |
119 | static pthread_mutex_t ecb_mf_lock = PTHREAD_MUTEX_INITIALIZER; |
121 | static pthread_mutex_t ecb_mf_lock = PTHREAD_MUTEX_INITIALIZER; |
120 | #define ECB_MEMORY_FENCE do { pthread_mutex_lock (&ecb_mf_lock); pthread_mutex_unlock (&ecb_mf_lock); } while (0) |
122 | #define ECB_MEMORY_FENCE do { pthread_mutex_lock (&ecb_mf_lock); pthread_mutex_unlock (&ecb_mf_lock); } while (0) |
121 | #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE |
123 | #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE |
122 | #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE |
124 | #define ECB_MEMORY_FENCE_RELEASE ECB_MEMORY_FENCE |