diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2022-09-22 15:40:37 +0100 |
---|---|---|
committer | Wilco Dijkstra <wdijkstr@arm.com> | 2022-09-23 15:59:56 +0100 |
commit | 4a07fbb689eeec30e7d71a0d144c26e0d1e424ac (patch) | |
tree | 85d53e165fb64b144ce9ac3018cd90afdd70bf4f /nptl/pthread_create.c | |
parent | d1babeb32de5dae8893c640bd925357b218d846c (diff) | |
download | glibc-4a07fbb689eeec30e7d71a0d144c26e0d1e424ac.zip glibc-4a07fbb689eeec30e7d71a0d144c26e0d1e424ac.tar.gz glibc-4a07fbb689eeec30e7d71a0d144c26e0d1e424ac.tar.bz2 |
Use C11 atomics instead of atomic_decrement_and_test
Replace atomic_decrement_and_test with atomic_fetch_add_relaxed.
These are simple counters which do not protect any shared data from
concurrent accesses. Also remove the unused file cond-perf.c.
Passes regress on AArch64.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r-- | nptl/pthread_create.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index 0df6748..54afee5 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -489,7 +489,7 @@ start_thread (void *arg) the breakpoint reports TD_THR_RUN state rather than TD_THR_ZOMBIE. */ atomic_fetch_or_relaxed (&pd->cancelhandling, EXITING_BITMASK); - if (__glibc_unlikely (atomic_decrement_and_test (&__nptl_nthreads))) + if (__glibc_unlikely (atomic_fetch_add_relaxed (&__nptl_nthreads, -1) == 1)) /* This was the last thread. */ exit (0); |