about summary refs log tree commit diff
path: root/sysdeps/htl/pt-cond-timedwait.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/htl/pt-cond-timedwait.c')
-rw-r--r--sysdeps/htl/pt-cond-timedwait.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/htl/pt-cond-timedwait.c b/sysdeps/htl/pt-cond-timedwait.c
index d9ce23b682..3a11e016d7 100644
--- a/sysdeps/htl/pt-cond-timedwait.c
+++ b/sysdeps/htl/pt-cond-timedwait.c
@@ -78,6 +78,10 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond,
   if (abstime && ! valid_nanoseconds (abstime->tv_nsec))
     return EINVAL;
 
+  err = __pthread_mutex_checklocked (mutex);
+  if (err)
+    return err;
+
   struct __pthread *self = _pthread_self ();
   struct cancel_ctx ctx;
   ctx.wakeup = self;