]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix last change.
authorUlrich Drepper <drepper@redhat.com>
Wed, 15 Mar 2000 07:53:39 +0000 (07:53 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 15 Mar 2000 07:53:39 +0000 (07:53 +0000)
linuxthreads/condvar.c

index 1d6e930b3552c8389c0af2a9ebe9276e8787e0e2..6b4a12b0e46b646372dc1fbc5b177cdb7ed64900 100644 (file)
@@ -143,6 +143,10 @@ pthread_cond_timedwait_relative_old(pthread_cond_t *cond,
   sigjmp_buf jmpbuf;
   pthread_extricate_if extr;
 
+  /* Check whether the mutex is locked and owned by this thread.  */
+  if (mutex->__m_owner != self)
+    return EINVAL;
+
   /* Set up extrication interface */
   extr.pu_object = cond;
   extr.pu_extricate_func = cond_extricate_func;
@@ -270,6 +274,10 @@ pthread_cond_timedwait_relative_new(pthread_cond_t *cond,
   sigjmp_buf jmpbuf;
   pthread_extricate_if extr;
 
+  /* Check whether the mutex is locked and owned by this thread.  */
+  if (mutex->__m_owner != self)
+    return EINVAL;
+
   /* Set up extrication interface */
   extr.pu_object = cond;
   extr.pu_extricate_func = cond_extricate_func;
@@ -381,10 +389,6 @@ pthread_cond_timedwait_relative_new(pthread_cond_t *cond,
 int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
                            const struct timespec * abstime)
 {
-  /* Check whether the mutex is locked and owned by this thread.  */
-  if (mutex->__m_owner != self)
-    return EINVAL;
-
   /* Indirect call through pointer! */
   return pthread_cond_tw_rel(cond, mutex, abstime);
 }