summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/pthreadpool/pthreadpool.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c
index 7538fb7995..9981ed25ae 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -427,7 +427,6 @@ static void *pthreadpool_server(void *arg)
}
while (1) {
- struct timeval tv;
struct timespec ts;
struct pthreadpool_job *job;
@@ -436,9 +435,8 @@ static void *pthreadpool_server(void *arg)
* time, exit this thread.
*/
- gettimeofday(&tv, NULL);
- ts.tv_sec = tv.tv_sec + 1;
- ts.tv_nsec = tv.tv_usec*1000;
+ clock_gettime(CLOCK_REALTIME, &ts);
+ ts.tv_sec += 1;
while ((pool->jobs == NULL) && (pool->shutdown == 0)) {