--- src/lib/Libutils/u_threadpool.c.orig 2011-06-21 17:30:02.000000000 -0500 +++ src/lib/Libutils/u_threadpool.c 2011-08-31 08:47:23.000000000 -0500 @@ -80,6 +80,9 @@ #include #include +#ifndef HAVE_CLOCK_GETTIME +#include +#endif #include #include "threadpool.h" #include "utils.h" @@ -208,6 +211,9 @@ tp_work_t *mywork; tp_working_t working; +#ifndef HAVE_CLOCK_GETTIME + struct timeval tv; +#endif struct timespec ts; if (request_pool == NULL) @@ -243,7 +249,13 @@ } else { +#ifndef HAVE_CLOCK_GETTIME + gettimeofday(&tv, NULL); + ts.tv_sec = tv.tv_sec; + ts.tv_nsec = 0; +#else clock_gettime(CLOCK_REALTIME,&ts); +#endif ts.tv_sec += request_pool->tp_max_idle_secs; rc = pthread_cond_timedwait(&request_pool->tp_waiting_work,&request_pool->tp_mutex,&ts);