diff options
Diffstat (limited to 'sysdeps/pthread')
-rw-r--r-- | sysdeps/pthread/aio_misc.c | 6 | ||||
-rw-r--r-- | sysdeps/pthread/aio_suspend.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sysdeps/pthread/aio_misc.c b/sysdeps/pthread/aio_misc.c index 6ff0132ecb..65b4b1ade8 100644 --- a/sysdeps/pthread/aio_misc.c +++ b/sysdeps/pthread/aio_misc.c @@ -614,13 +614,13 @@ handle_fildes_io (void *arg) something to arrive in it. */ if (runp == NULL && optim.aio_idle_time >= 0) { - struct timeval now; + struct timespec now; struct timespec wakeup_time; ++idle_thread_count; - __gettimeofday (&now, NULL); + __clock_gettime (CLOCK_REALTIME, &now); wakeup_time.tv_sec = now.tv_sec + optim.aio_idle_time; - wakeup_time.tv_nsec = now.tv_usec * 1000; + wakeup_time.tv_nsec = now.tv_nsec; if (wakeup_time.tv_nsec >= 1000000000) { wakeup_time.tv_nsec -= 1000000000; diff --git a/sysdeps/pthread/aio_suspend.c b/sysdeps/pthread/aio_suspend.c index ad654e1d08..bb324a5fe6 100644 --- a/sysdeps/pthread/aio_suspend.c +++ b/sysdeps/pthread/aio_suspend.c @@ -183,11 +183,11 @@ aio_suspend (const struct aiocb *const list[], int nent, { /* We have to convert the relative timeout value into an absolute time value with pthread_cond_timedwait expects. */ - struct timeval now; + struct timespec now; struct timespec abstime; - __gettimeofday (&now, NULL); - abstime.tv_nsec = timeout->tv_nsec + now.tv_usec * 1000; + __clock_gettime (CLOCK_REALTIME, &now); + abstime.tv_nsec = timeout->tv_nsec + now.tv_nsec; abstime.tv_sec = timeout->tv_sec + now.tv_sec; if (abstime.tv_nsec >= 1000000000) { |