about summary refs log tree commit diff
path: root/nptl/allocatestack.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r--nptl/allocatestack.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 33fbbaa850..59f00d9231 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -445,8 +445,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 
 #if COLORING_INCREMENT != 0
 	  /* Atomically increment NCREATED.  */
-	  unsigned int ncreated = (atomic_exchange_and_add (&nptl_ncreated, 1)
-				   + 1);
+	  unsigned int ncreated = atomic_increment_val (&nptl_ncreated);
 
 	  /* We chose the offset for coloring by incrementing it for
 	     every new thread by a fixed amount.  The offset used