aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/nptl
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2022-09-13 11:58:07 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2022-09-13 11:58:07 +0100
commita30e960328fc60e066967d1224ecd5b6e173cda3 (patch)
tree20fe8ff72d39d2c4fe3d867a19e88621bbd095c5 /sysdeps/nptl
parentf278835f594740f5913001430641cf1da4878670 (diff)
downloadglibc-a30e960328fc60e066967d1224ecd5b6e173cda3.tar
glibc-a30e960328fc60e066967d1224ecd5b6e173cda3.tar.gz
glibc-a30e960328fc60e066967d1224ecd5b6e173cda3.tar.bz2
glibc-a30e960328fc60e066967d1224ecd5b6e173cda3.zip
Use relaxed atomics since there is no MO dependence
Replace the 3 uses of atomic_bit_set and atomic_bit_test_set with atomic_fetch_or_relaxed. Using relaxed MO is correct since the atomics are used to ensure memory is released only once. Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'sysdeps/nptl')
-rw-r--r--sysdeps/nptl/pthreadP.h8
1 files changed, 1 insertions, 7 deletions
diff --git a/sysdeps/nptl/pthreadP.h b/sysdeps/nptl/pthreadP.h
index 39af275c25..c8521b0b23 100644
--- a/sysdeps/nptl/pthreadP.h
+++ b/sysdeps/nptl/pthreadP.h
@@ -43,12 +43,6 @@
atomic_compare_and_exchange_val_acq (&(descr)->member, new, old)
#endif
-#ifndef THREAD_ATOMIC_BIT_SET
-# define THREAD_ATOMIC_BIT_SET(descr, member, bit) \
- atomic_bit_set (&(descr)->member, bit)
-#endif
-
-
static inline short max_adaptive_count (void)
{
#if HAVE_TUNABLES
@@ -276,7 +270,7 @@ __do_cancel (void)
struct pthread *self = THREAD_SELF;
/* Make sure we get no more cancellations. */
- atomic_bit_set (&self->cancelhandling, EXITING_BIT);
+ atomic_fetch_or_relaxed (&self->cancelhandling, EXITING_BITMASK);
__pthread_unwind ((__pthread_unwind_buf_t *)
THREAD_GETMEM (self, cleanup_jmp_buf));