diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2003-04-28 23:56:12 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2003-04-28 23:56:12 +0000 |
| commit | 55613576f5c40d62fecb4ab76f012917fc399c3e (patch) | |
| tree | 90f4ce3660289c401aab5d0a2c4f105e5aa3e877 /lib/libpthread/thread/thr_cond.c | |
| parent | 6a9ccd81fefc8a10772034a7e4955fccdacc347f (diff) | |
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_cond.c')
| -rw-r--r-- | lib/libpthread/thread/thr_cond.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_cond.c b/lib/libpthread/thread/thr_cond.c index 537c264956a5b..32a152ddef155 100644 --- a/lib/libpthread/thread/thr_cond.c +++ b/lib/libpthread/thread/thr_cond.c @@ -267,6 +267,7 @@ _pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) * lock); we should be able to safely * set the state. */ + THR_LOCK_SWITCH(curthread); THR_SET_STATE(curthread, PS_COND_WAIT); /* Remember the CV: */ @@ -280,6 +281,7 @@ _pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) _thr_sched_switch(curthread); curthread->data.cond = NULL; + THR_UNLOCK_SWITCH(curthread); /* * XXX - This really isn't a good check @@ -324,8 +326,10 @@ _pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) * that the mutex be reaquired prior to * cancellation. */ - if (done != 0) + if (done != 0) { rval = _mutex_cv_lock(mutex); + unlock_mutex = 1; + } } } break; @@ -475,6 +479,7 @@ _pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, * lock); we should be able to safely * set the state. */ + THR_LOCK_SWITCH(curthread); THR_SET_STATE(curthread, PS_COND_WAIT); /* Remember the CV: */ @@ -488,6 +493,7 @@ _pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, _thr_sched_switch(curthread); curthread->data.cond = NULL; + THR_UNLOCK_SWITCH(curthread); /* * XXX - This really isn't a good check |
