about summary refs log tree commit diff
path: root/linuxthreads/condvar.c
diff options
context:
space:
mode:
Diffstat (limited to 'linuxthreads/condvar.c')
-rw-r--r--linuxthreads/condvar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/linuxthreads/condvar.c b/linuxthreads/condvar.c
index ae1cef1ea9..f9c46a3316 100644
--- a/linuxthreads/condvar.c
+++ b/linuxthreads/condvar.c
@@ -103,7 +103,8 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
     {
       suspend(self);
       if (THREAD_GETMEM(self, p_condvar_avail) == 0
-	  && THREAD_GETMEM(self, p_woken_by_cancel) == 0)
+	  && (THREAD_GETMEM(self, p_woken_by_cancel) == 0
+	      || THREAD_GETMEM(self, p_cancelstate) != PTHREAD_CANCEL_ENABLE))
 	{
 	  /* Count resumes that don't belong to us. */
 	  spurious_wakeup_count++;
@@ -196,7 +197,8 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
       }
 
       if (THREAD_GETMEM(self, p_condvar_avail) == 0
-	  && THREAD_GETMEM(self, p_woken_by_cancel) == 0)
+	  && (THREAD_GETMEM(self, p_woken_by_cancel) == 0
+	      || THREAD_GETMEM(self, p_cancelstate) != PTHREAD_CANCEL_ENABLE))
 	{
 	  /* Count resumes that don't belong to us. */
 	  spurious_wakeup_count++;