Minimize use of AO_ATTR_NO_SANITIZE_THREAD in atomic_ops_malloc/stack
(fix commit
c058d9d)
* src/atomic_ops_malloc.c [AO_THREAD_SANITIZER] (AO_malloc):
Use AO_store() only if AO_USE_ALMOST_LOCK_FREE; add comment.
* src/atomic_ops_malloc.c (AO_free): Remove TSan workaround (do not
check AO_THREAD_SANITIZER macro).
* src/atomic_ops_stack.c (AO_copy_before_cas): New inline function.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
(AO_stack_push_explicit_aux_release): Remove AO_ATTR_NO_SANITIZE_THREAD.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE
&& AO_HAVE_compare_double_and_swap_double] (AO_stack_push_release,
AO_stack_pop_acquire): Likewise.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
(AO_stack_push_explicit_aux_release): Replace *x=next with
AO_copy_before_cas(x,&next).
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE]
(AO_stack_push_release): Likewise.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE] (AO_stack_pop_acquire):
Replace next=*cptr with AO_copy_before_cas(&next,cptr).
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE
&& AO_HAVE_compare_and_swap_double] (AO_stack_pop_acquire): Reformat
code.