]> granicus.if.org Git - libatomic_ops/commit
Minimize use of AO_ATTR_NO_SANITIZE_THREAD in atomic_ops_malloc/stack
authorIvan Maidanski <ivmai@mail.ru>
Thu, 7 Dec 2017 08:14:46 +0000 (11:14 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 7 Dec 2017 08:14:46 +0000 (11:14 +0300)
commit6ffda1db770f8c028dcbd06f71f9160c80b1e332
treec7b1f40b64f73811cce46012869cca00ce64665c
parent305b229418c754afc0cb372048857f996fe90b71
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.
src/atomic_ops_malloc.c
src/atomic_ops_stack.c