about summary refs log tree commit diff
path: root/htl/pt-exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'htl/pt-exit.c')
-rw-r--r--htl/pt-exit.c2
1 files changed, 1 insertions, 1 deletions
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);