summaryrefslogtreecommitdiff
path: root/sysdeps/generic/pt-cond-timedwait.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-08-30 23:29:21 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-08-30 23:29:21 +0200
commit6b1ebd29a16f2c2c91f8fcae4ce2b5dd62143821 (patch)
tree026e82163d438015f9fe828e16a174ee1a405803 /sysdeps/generic/pt-cond-timedwait.c
parent13aeb1df3614cbb0c0dc074427ab2f95160af0bb (diff)
parent0096579c8bea920f7c42b40ea22db621da6480a5 (diff)
Merge commit 'refs/top-bases/t/fix_have_kernel_resources' into t/fix_have_kernel_resourcest/fix_have_kernel_resources
Diffstat (limited to 'sysdeps/generic/pt-cond-timedwait.c')
-rw-r--r--sysdeps/generic/pt-cond-timedwait.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysdeps/generic/pt-cond-timedwait.c b/sysdeps/generic/pt-cond-timedwait.c
index c10bdb3..56eb1ec 100644
--- a/sysdeps/generic/pt-cond-timedwait.c
+++ b/sysdeps/generic/pt-cond-timedwait.c
@@ -26,13 +26,15 @@ extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond,
const struct timespec *abstime);
int
-pthread_cond_timedwait (pthread_cond_t *cond,
+__pthread_cond_timedwait (pthread_cond_t *cond,
pthread_mutex_t *mutex,
const struct timespec *abstime)
{
return __pthread_cond_timedwait_internal (cond, mutex, abstime);
}
+strong_alias (__pthread_cond_timedwait, pthread_cond_timedwait);
+
/* Block on condition variable COND until ABSTIME. As a GNU
extension, if ABSTIME is NULL, then wait forever. MUTEX should be
held by the calling thread. On return, MUTEX will be held by the
@@ -44,6 +46,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond,
{
error_t err;
int canceltype;
+ clockid_t clock_id = __pthread_default_condattr.clock;
void cleanup (void *arg)
{
@@ -66,6 +69,8 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond,
/* Add ourselves to the list of waiters. */
__pthread_spin_lock (&cond->__lock);
__pthread_enqueue (&cond->__queue, self);
+ if (cond->__attr)
+ clock_id = cond->__attr->clock;
__pthread_spin_unlock (&cond->__lock);
__pthread_mutex_unlock (mutex);
@@ -77,7 +82,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond,
if (abstime)
{
- err = __pthread_timedblock (self, abstime);
+ err = __pthread_timedblock (self, abstime, clock_id);
if (err)
/* We timed out. We may need to disconnect ourself from the
waiter queue.