aboutsummaryrefslogtreecommitdiff
path: root/nptl/pthread_cond_wait.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-29 16:15:48 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-29 16:15:48 +0000
commitee5d5755a826eb7b48bdf020bef397a33868780b (patch)
tree54bfdd1a4b47b26d97b3dada3c78d729405718ac /nptl/pthread_cond_wait.c
parent5da4373cfd0bf070ec3ece378c4dea9b027c0ce2 (diff)
downloadglibc-ee5d5755a826eb7b48bdf020bef397a33868780b.tar
glibc-ee5d5755a826eb7b48bdf020bef397a33868780b.tar.gz
glibc-ee5d5755a826eb7b48bdf020bef397a33868780b.tar.bz2
glibc-ee5d5755a826eb7b48bdf020bef397a33868780b.zip
* 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.
Diffstat (limited to 'nptl/pthread_cond_wait.c')
-rw-r--r--nptl/pthread_cond_wait.c12
1 files changed, 6 insertions, 6 deletions
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 <schwidefsky@de.ibm.com>, 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. */