From 4a07fbb689eeec30e7d71a0d144c26e0d1e424ac Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Thu, 22 Sep 2022 15:40:37 +0100 Subject: 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 --- sysdeps/nptl/libc_start_call_main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdeps/nptl') diff --git a/sysdeps/nptl/libc_start_call_main.h b/sysdeps/nptl/libc_start_call_main.h index a9e85f2..c10a16b 100644 --- a/sysdeps/nptl/libc_start_call_main.h +++ b/sysdeps/nptl/libc_start_call_main.h @@ -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); -- cgit v1.1