mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user