about summary refs log tree commit diff
path: root/htl
diff options
context:
space:
mode:
Diffstat (limited to 'htl')
-rw-r--r--htl/pt-dealloc.c2
-rw-r--r--htl/pt-exit.c2
2 files changed, 2 insertions, 2 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.  */
diff --git a/htl/pt-exit.c b/htl/pt-exit.c
index f0759c8738..3c0a8c52f3 100644
--- a/htl/pt-exit.c
+++ b/htl/pt-exit.c
@@ -50,7 +50,7 @@ __pthread_exit (void *status)
 
   /* Decrease the number of threads.  We use an atomic operation to
      make sure that only the last thread calls `exit'.  */
-  if (atomic_decrement_and_test (&__pthread_total))
+  if (atomic_fetch_add_relaxed (&__pthread_total, -1) == 1)
     /* We are the last thread.  */
     exit (0);