mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-13 10:52:56 +01:00
Problem: atomic intrinsics unreliable on PPC64 and RISC-V
Solution: prefer CXX11 atomics if they are available to compiler intrinsics. test_hwm_pubsub fails 50% of the times on PPC64 and RISC-V with an apparent memory corruption of messages sent by the application thread to the I/O thread when using compiler intrinsics. Switching to CXX11 atomics makes the test reliable again. The standard API should be preferred anyway, if available.
This commit is contained in:
parent
8040e28b26
commit
bfb4a868fc
@ -35,11 +35,11 @@
|
||||
|
||||
#if defined ZMQ_FORCE_MUTEXES
|
||||
#define ZMQ_ATOMIC_COUNTER_MUTEX
|
||||
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
|
||||
#define ZMQ_ATOMIC_COUNTER_INTRINSIC
|
||||
#elif (defined __cplusplus && __cplusplus >= 201103L) \
|
||||
|| (defined _MSC_VER && _MSC_VER >= 1900)
|
||||
#define ZMQ_ATOMIC_COUNTER_CXX11
|
||||
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
|
||||
#define ZMQ_ATOMIC_COUNTER_INTRINSIC
|
||||
#elif (defined __i386__ || defined __x86_64__) && defined __GNUC__
|
||||
#define ZMQ_ATOMIC_COUNTER_X86
|
||||
#elif defined __ARM_ARCH_7A__ && defined __GNUC__
|
||||
|
@ -34,11 +34,11 @@
|
||||
|
||||
#if defined ZMQ_FORCE_MUTEXES
|
||||
#define ZMQ_ATOMIC_PTR_MUTEX
|
||||
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
|
||||
#define ZMQ_ATOMIC_PTR_INTRINSIC
|
||||
#elif (defined __cplusplus && __cplusplus >= 201103L) \
|
||||
|| (defined _MSC_VER && _MSC_VER >= 1900)
|
||||
#define ZMQ_ATOMIC_PTR_CXX11
|
||||
#elif defined ZMQ_HAVE_ATOMIC_INTRINSICS
|
||||
#define ZMQ_ATOMIC_PTR_INTRINSIC
|
||||
#elif (defined __i386__ || defined __x86_64__) && defined __GNUC__
|
||||
#define ZMQ_ATOMIC_PTR_X86
|
||||
#elif defined __ARM_ARCH_7A__ && defined __GNUC__
|
||||
|
Loading…
Reference in New Issue
Block a user