From ee5d5755a826eb7b48bdf020bef397a33868780b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 29 May 2007 16:15:48 +0000 Subject: * sysdeps/unix/sysv/linux/internaltypes.h: Introduce COND_NWAITERS_SHIFT. * pthread_cond_destroy.c: Use COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS. * pthread_cond_init.c: Likewise. * pthread_cond_timedwait.c: Likewise. * pthread_cond_wait.c: Likewise. * pthread_condattr_getclock.c: Likewise. * pthread_condattr_setclock.c: Likewise. * sysdeps/unix/sysv/linux/lowlevelcond.sym: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise. * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise. --- nptl/pthread_cond_wait.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'nptl/pthread_cond_wait.c') diff --git a/nptl/pthread_cond_wait.c b/nptl/pthread_cond_wait.c index f5f5cec5a8..6e00a28f6a 100644 --- a/nptl/pthread_cond_wait.c +++ b/nptl/pthread_cond_wait.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky , 2003. @@ -62,14 +62,14 @@ __condvar_cleanup (void *arg) ++cbuffer->cond->__data.__woken_seq; } - cbuffer->cond->__data.__nwaiters -= 1 << COND_CLOCK_BITS; + cbuffer->cond->__data.__nwaiters -= 1 << COND_NWAITERS_SHIFT; /* If pthread_cond_destroy was called on this variable already, notify the pthread_cond_destroy caller all waiters have left and it can be successfully destroyed. */ destroying = 0; if (cbuffer->cond->__data.__total_seq == -1ULL - && cbuffer->cond->__data.__nwaiters < (1 << COND_CLOCK_BITS)) + && cbuffer->cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT)) { lll_futex_wake (&cbuffer->cond->__data.__nwaiters, 1); destroying = 1; @@ -111,7 +111,7 @@ __pthread_cond_wait (cond, mutex) /* We have one new user of the condvar. */ ++cond->__data.__total_seq; ++cond->__data.__futex; - cond->__data.__nwaiters += 1 << COND_CLOCK_BITS; + cond->__data.__nwaiters += 1 << COND_NWAITERS_SHIFT; /* Remember the mutex we are using here. If there is already a different address store this is a bad user bug. Do not store @@ -168,13 +168,13 @@ __pthread_cond_wait (cond, mutex) bc_out: - cond->__data.__nwaiters -= 1 << COND_CLOCK_BITS; + cond->__data.__nwaiters -= 1 << COND_NWAITERS_SHIFT; /* If pthread_cond_destroy was called on this varaible already, notify the pthread_cond_destroy caller all waiters have left and it can be successfully destroyed. */ if (cond->__data.__total_seq == -1ULL - && cond->__data.__nwaiters < (1 << COND_CLOCK_BITS)) + && cond->__data.__nwaiters < (1 << COND_NWAITERS_SHIFT)) lll_futex_wake (&cond->__data.__nwaiters, 1); /* We are done with the condvar. */ -- cgit v1.2.1