about summary refs log tree commit diff
path: root/htl/pt-dealloc.c
diff options
context:
space:
mode:
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 c776e3471d..86bbb3091f 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.  */