aboutsummaryrefslogtreecommitdiff
path: root/htl/pt-dealloc.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2022-09-22 15:40:37 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2022-09-23 15:59:56 +0100
commit4a07fbb689eeec30e7d71a0d144c26e0d1e424ac (patch)
tree85d53e165fb64b144ce9ac3018cd90afdd70bf4f /htl/pt-dealloc.c
parentd1babeb32de5dae8893c640bd925357b218d846c (diff)
downloadglibc-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 'htl/pt-dealloc.c')
-rw-r--r--htl/pt-dealloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/htl/pt-dealloc.c b/htl/pt-dealloc.c
index c776e34..86bbb30 100644
--- a/htl/pt-dealloc.c
+++ b/htl/pt-dealloc.c
@@ -33,7 +33,7 @@ extern pthread_mutex_t __pthread_free_threads_lock;
void
__pthread_dealloc (struct __pthread *pthread)
{
- if (!atomic_decrement_and_test (&pthread->nr_refs))
+ if (atomic_fetch_add_relaxed (&pthread->nr_refs, -1) != 1)
return;
/* Withdraw this thread from the thread ID lookup table. */