From a56b526b51e914143185b26ce10e48e83e1d1e06 Mon Sep 17 00:00:00 2001 From: David Xu Date: Sat, 28 Jun 2003 09:40:57 +0000 Subject: [PATCH] After thread was interrupted by signal, it should relock mutex. Reviewed by: deischen --- lib/libkse/thread/thr_cond.c | 3 +-- lib/libpthread/thread/thr_cond.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libkse/thread/thr_cond.c b/lib/libkse/thread/thr_cond.c index b352ba3be3c9..59db00fc8dae 100644 --- a/lib/libkse/thread/thr_cond.c +++ b/lib/libkse/thread/thr_cond.c @@ -539,8 +539,7 @@ _pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, /* The wait timedout. */ rval = ETIMEDOUT; (void)_mutex_cv_lock(mutex); - } else if ((interrupted == 0) || - (done != 0)) + } else if (interrupted || done) rval = _mutex_cv_lock(mutex); } } diff --git a/lib/libpthread/thread/thr_cond.c b/lib/libpthread/thread/thr_cond.c index b352ba3be3c9..59db00fc8dae 100644 --- a/lib/libpthread/thread/thr_cond.c +++ b/lib/libpthread/thread/thr_cond.c @@ -539,8 +539,7 @@ _pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, /* The wait timedout. */ rval = ETIMEDOUT; (void)_mutex_cv_lock(mutex); - } else if ((interrupted == 0) || - (done != 0)) + } else if (interrupted || done) rval = _mutex_cv_lock(mutex); } }