(pthread_cond_timedwait_relative): Don't test for owner if fast mutex
authordrepper <drepper>
Mon, 17 Apr 2000 06:52:46 +0000 (06:52 +0000)
committerdrepper <drepper>
Mon, 17 Apr 2000 06:52:46 +0000 (06:52 +0000)
is used.  Don't initialize `already_canceled' twice.  Correctly test
for return value of timedsuspend.

linuxthreads/condvar.c

index a06517c..ab107c1 100644 (file)
@@ -121,11 +121,9 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
   pthread_extricate_if extr;
 
   /* Check whether the mutex is locked and owned by this thread.  */
-  if (mutex->__m_owner != self)
+  if (mutex->__m_kind != PTHREAD_MUTEX_FAST_NP && mutex->__m_owner != self)
     return EINVAL;
 
-  already_canceled = 0;
-
   /* Set up extrication interface */
   extr.pu_object = cond;
   extr.pu_extricate_func = cond_extricate_func;
@@ -149,7 +147,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
 
   pthread_mutex_unlock(mutex);
 
-  if (!timedsuspend(self, abstime) == 0) {
+  if (!timedsuspend(self, abstime)) {
     int was_on_queue;
 
     /* __pthread_lock will queue back any spurious restarts that