mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
MINOR: threads: add a portable barrier for threads and non-threads
HA_BARRIER() is just a simple memory barrier to prevent the compiler from reordering our code.
This commit is contained in:
parent
2510f702f9
commit
b29dc95a97
1 changed files with 3 additions and 0 deletions
|
|
@ -60,6 +60,7 @@ extern THREAD_LOCAL unsigned int tid_bit; /* The bit corresponding to the thread
|
|||
*(val); \
|
||||
})
|
||||
|
||||
#define HA_BARRIER() do { } while (0)
|
||||
|
||||
#define THREAD_SYNC_INIT(m) do { /* do nothing */ } while(0)
|
||||
#define THREAD_SYNC_ENABLE() do { /* do nothing */ } while(0)
|
||||
|
|
@ -118,6 +119,8 @@ extern THREAD_LOCAL unsigned int tid_bit; /* The bit corresponding to the thread
|
|||
(*val); \
|
||||
})
|
||||
|
||||
#define HA_BARRIER() pl_barrier()
|
||||
|
||||
#define THREAD_SYNC_INIT(m) thread_sync_init(m)
|
||||
#define THREAD_SYNC_ENABLE() thread_sync_enable()
|
||||
#define THREAD_WANT_SYNC() thread_want_sync()
|
||||
|
|
|
|||
Loading…
Reference in a new issue