From 69431c9a21f7393f34330a27df1630520930789e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 26 May 2003 02:47:39 +0000 Subject: Update. 2003-05-25 Ulrich Drepper * sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_FUTEX_REQUEUE for >= 2.5.70. * math/test-fenv.c (feexcp_nomask_test): Fix comment. --- nptl/sysdeps/pthread/pthread_cond_wait.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'nptl/sysdeps/pthread/pthread_cond_wait.c') diff --git a/nptl/sysdeps/pthread/pthread_cond_wait.c b/nptl/sysdeps/pthread/pthread_cond_wait.c index 708566be03..da94cc2d6b 100644 --- a/nptl/sysdeps/pthread/pthread_cond_wait.c +++ b/nptl/sysdeps/pthread/pthread_cond_wait.c @@ -65,8 +65,7 @@ __condvar_cleanup (void *arg) /* Get the mutex before returning unless asynchronous cancellation is in effect. */ - if (!(cbuffer->oldtype & CANCELTYPE_BITMASK)) - __pthread_mutex_lock_internal (cbuffer->mutex); + __pthread_mutex_cond_lock (cbuffer->mutex); } @@ -93,6 +92,10 @@ __pthread_cond_wait (cond, mutex) /* We have one new user of the condvar. */ ++cond->__data.__total_seq; + /* Remember the mutex we are using here. If there is already a + different address store this is a bad user bug. */ + cond->__data.__mutex = mutex; + /* Prepare structure passed to cancellation handler. */ cbuffer.cond = cond; cbuffer.mutex = mutex; @@ -123,7 +126,7 @@ __pthread_cond_wait (cond, mutex) lll_mutex_unlock (cond->__data.__lock); /* Enable asynchronous cancellation. Required by the standard. */ - __pthread_enable_asynccancel_2 (&cbuffer.oldtype); + cbuffer.oldtype = __pthread_enable_asynccancel (); /* Wait until woken by signal or broadcast. Note that we truncate the 'val' value to 32 bits. */ @@ -150,7 +153,7 @@ __pthread_cond_wait (cond, mutex) __pthread_cleanup_pop (&buffer, 0); /* Get the mutex before returning. */ - return __pthread_mutex_lock_internal (mutex); + return __pthread_mutex_cond_lock (mutex); } versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait, -- cgit 1.4.1