From 91958edc8459a45bc8c0b6d355ffbfdd245296fb Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 20 Mar 2003 08:58:35 +0000 Subject: (allocate_stack): Assume atomic_exchange_and_add returns the old value. --- nptl/allocatestack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nptl/allocatestack.c') 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 -- cgit v1.2.3