]> sourceware.org Git - glibc.git/commitdiff
(allocate_stack): Assume atomic_exchange_and_add returns the old value.
authorUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 2003 08:58:35 +0000 (08:58 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 20 Mar 2003 08:58:35 +0000 (08:58 +0000)
nptl/allocatestack.c

index f22f304347f969700b82a67beaa2638806bac9fc..c199cf21d487967d7f49dca55fd9fb9e14bcff54 100644 (file)
@@ -400,7 +400,8 @@ 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);
+         unsigned int ncreated = (atomic_exchange_and_add (&nptl_ncreated, 1)
+                                  + 1);
 
          /* We chose the offset for coloring by incrementing it for
             every new thread by a fixed amount.  The offset used
This page took 0.043338 seconds and 5 git commands to generate.