aboutsummaryrefslogtreecommitdiff
path: root/nptl/pthread_join_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/pthread_join_common.c')
-rw-r--r--nptl/pthread_join_common.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/nptl/pthread_join_common.c b/nptl/pthread_join_common.c
index 8b55c380e9..4d91c6fbf2 100644
--- a/nptl/pthread_join_common.c
+++ b/nptl/pthread_join_common.c
@@ -47,15 +47,14 @@ timedwait_tid (pid_t *tidp, const struct timespec *abstime)
/* Repeat until thread terminated. */
while ((tid = *tidp) != 0)
{
- struct timeval tv;
struct timespec rt;
/* Get the current time. */
- __gettimeofday (&tv, NULL);
+ __clock_gettime (CLOCK_REALTIME, &rt);
/* Compute relative timeout. */
- rt.tv_sec = abstime->tv_sec - tv.tv_sec;
- rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000;
+ rt.tv_sec = abstime->tv_sec - rt.tv_sec;
+ rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec;
if (rt.tv_nsec < 0)
{
rt.tv_nsec += 1000000000;