summaryrefslogtreecommitdiff
path: root/source3/lib/pthreadpool/pthreadpool.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/pthreadpool/pthreadpool.c')
-rw-r--r--source3/lib/pthreadpool/pthreadpool.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c
index c2dd92ac52..04303776a2 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -17,16 +17,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "config.h"
#include <errno.h>
#include <stdio.h>
-#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <signal.h>
#include <assert.h>
#include <fcntl.h>
-#include <sys/time.h>
+#include "system/time.h"
+#include "system/filesys.h"
+#include "replace.h"
#include "pthreadpool.h"
#include "lib/util/dlinklist.h"
@@ -428,7 +430,6 @@ static void *pthreadpool_server(void *arg)
}
while (1) {
- struct timeval tv;
struct timespec ts;
struct pthreadpool_job *job;
@@ -437,9 +438,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)) {