From: Ulrich Drepper Date: Thu, 20 Mar 2003 08:58:35 +0000 (+0000) Subject: (allocate_stack): Assume atomic_exchange_and_add returns the old value. X-Git-Tag: cvs/glibc-2_3_3~1145 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91958edc8459a45bc8c0b6d355ffbfdd245296fb;p=thirdparty%2Fglibc.git (allocate_stack): Assume atomic_exchange_and_add returns the old value. --- diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index f22f304347f..c199cf21d48 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