aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-20 08:58:35 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-20 08:58:35 +0000
commit91958edc8459a45bc8c0b6d355ffbfdd245296fb (patch)
tree9dc0d1c6873e14d136dbeeddb91b9c5ef1e761b1
parentbfd49d5558cc88986cc95f70aa5646902ebd8ad4 (diff)
downloadglibc-91958edc8459a45bc8c0b6d355ffbfdd245296fb.tar
glibc-91958edc8459a45bc8c0b6d355ffbfdd245296fb.tar.gz
glibc-91958edc8459a45bc8c0b6d355ffbfdd245296fb.tar.bz2
glibc-91958edc8459a45bc8c0b6d355ffbfdd245296fb.zip
(allocate_stack): Assume atomic_exchange_and_add returns the old value.
-rw-r--r--nptl/allocatestack.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index f22f304347..c199cf21d4 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -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