summaryrefslogtreecommitdiff
path: root/sysdeps/generic/pt-cond-timedwait.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-08-30 23:29:02 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-08-30 23:29:02 +0200
commit0096579c8bea920f7c42b40ea22db621da6480a5 (patch)
tree13624908cf430569082784ade52d97b94de8762c /sysdeps/generic/pt-cond-timedwait.c
parentd3f9d546c97402cd7d039fb6f3e3242327805784 (diff)
parent640cfa0a4af3dc399bff496fd94081a99dbbcdd2 (diff)
Merge commit 'refs/top-bases/baseline' into baselinebaseline
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.