diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-03-20 08:58:35 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-03-20 08:58:35 +0000 |
commit | 91958edc8459a45bc8c0b6d355ffbfdd245296fb (patch) | |
tree | 9dc0d1c6873e14d136dbeeddb91b9c5ef1e761b1 /nptl/allocatestack.c | |
parent | bfd49d5558cc88986cc95f70aa5646902ebd8ad4 (diff) | |
download | glibc-91958edc8459a45bc8c0b6d355ffbfdd245296fb.tar.gz |
(allocate_stack): Assume atomic_exchange_and_add returns the old value.
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r-- | nptl/allocatestack.c | 3 |
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 |