diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2017-12-21 00:52:57 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2017-12-21 00:52:57 +0300 |
commit | a8abb4390ec5df82a4aefa38f104c0947ffa1361 (patch) | |
tree | bd5652ac20ae26b1ade55dfcbf4191ced459c3b3 /src | |
parent | 921404579338e846a8d8b418ffb5dcb23066b27f (diff) | |
download | libatomic_ops-a8abb4390ec5df82a4aefa38f104c0947ffa1361.tar.gz |
New macro to select stack implementation based on CAS-double
The macro is AO_STACK_PREFER_CAS_DOUBLE. This is only for testing.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE
&& AO_HAVE_compare_double_and_swap_double && AO_STACK_PREFER_CAS_DOUBLE
&& AO_HAVE_compare_and_swap_double] (AO_stack_pop_acquire,
AO_stack_pop_acquire): Use implementation based compare_and_swap_double
instead of compare_double_and_swap_double); remove #error directive.
Diffstat (limited to 'src')
-rw-r--r-- | src/atomic_ops_stack.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/atomic_ops_stack.c b/src/atomic_ops_stack.c index 049df98..5219fdf 100644 --- a/src/atomic_ops_stack.c +++ b/src/atomic_ops_stack.c @@ -208,7 +208,9 @@ AO_stack_pop_explicit_aux_acquire(volatile AO_t *list, AO_stack_aux * a) #define ptr AO_val2 #define version AO_val1 -#if defined(AO_HAVE_compare_double_and_swap_double) +#if defined(AO_HAVE_compare_double_and_swap_double) \ + && !(defined(AO_STACK_PREFER_CAS_DOUBLE) \ + && defined(AO_HAVE_compare_and_swap_double)) #ifdef LINT2 volatile /* non-static */ AO_t AO_noop_sink; @@ -262,10 +264,7 @@ AO_t *AO_stack_pop_acquire(AO_stack_t *list) #elif defined(AO_HAVE_compare_and_swap_double) /* Needed for future IA64 processors. No current clients? */ - -#if !defined(CPPCHECK) -# error Untested! Probably does not work. -#endif +/* TODO: Not tested thoroughly. */ /* We have a wide CAS, but only does an AO_t-wide comparison. */ /* We can't use the Treiber optimization, since we only check */ |