aboutsummaryrefslogtreecommitdiff
path: root/nptl/pthread_create.c
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 /nptl/pthread_create.c
parentf278835f594740f5913001430641cf1da4878670 (diff)
downloadglibc-a30e960328fc60e066967d1224ecd5b6e173cda3.zip
glibc-a30e960328fc60e066967d1224ecd5b6e173cda3.tar.gz
glibc-a30e960328fc60e066967d1224ecd5b6e173cda3.tar.bz2
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 'nptl/pthread_create.c')
-rw-r--r--nptl/pthread_create.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index e7e4ede..ee29cb3 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -487,7 +487,7 @@ start_thread (void *arg)
/* The thread is exiting now. Don't set this bit until after we've hit
the event-reporting breakpoint, so that td_thr_get_info on us while at
the breakpoint reports TD_THR_RUN state rather than TD_THR_ZOMBIE. */
- atomic_bit_set (&pd->cancelhandling, EXITING_BIT);
+ atomic_fetch_or_relaxed (&pd->cancelhandling, EXITING_BITMASK);
if (__glibc_unlikely (atomic_decrement_and_test (&__nptl_nthreads)))
/* This was the last thread. */