diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-05-26 02:47:39 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-05-26 02:47:39 +0000 |
commit | 69431c9a21f7393f34330a27df1630520930789e (patch) | |
tree | 1fbd3f1520502c833e676afa3fb5410f92654f85 /nptl/sysdeps/pthread/pthread_cond_wait.c | |
parent | 6a998b09ec734d8dd40e690244122a43bf9d7a16 (diff) | |
download | glibc-69431c9a21f7393f34330a27df1630520930789e.tar.gz glibc-69431c9a21f7393f34330a27df1630520930789e.tar.xz glibc-69431c9a21f7393f34330a27df1630520930789e.zip |
Update.
2003-05-25 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_FUTEX_REQUEUE for >= 2.5.70. * math/test-fenv.c (feexcp_nomask_test): Fix comment.
Diffstat (limited to 'nptl/sysdeps/pthread/pthread_cond_wait.c')
-rw-r--r-- | nptl/sysdeps/pthread/pthread_cond_wait.c | 11 |
1 files changed, 7 insertions, 4 deletions
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, |