mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +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:
@@ -65,7 +65,7 @@ __libc_start_call_main (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
|
||||
/* One less thread. Decrement the counter. If it is zero we
|
||||
terminate the entire process. */
|
||||
result = 0;
|
||||
if (! atomic_decrement_and_test (&__nptl_nthreads))
|
||||
if (atomic_fetch_add_relaxed (&__nptl_nthreads, -1) != 1)
|
||||
/* Not much left to do but to exit the thread, not the process. */
|
||||
while (1)
|
||||
INTERNAL_SYSCALL_CALL (exit, 0);
|
||||
|
Reference in New Issue
Block a user