Signed-off-by: Jens Axboe <axboe@kernel.dk>
pthread_condattr_setpshared(&cond, PTHREAD_PROCESS_SHARED);
#endif
pthread_cond_init(&mutex->cond, &cond);
pthread_condattr_setpshared(&cond, PTHREAD_PROCESS_SHARED);
#endif
pthread_cond_init(&mutex->cond, &cond);
+#ifdef FIO_HAVE_CLOCK_MONOTONIC
+ pthread_condattr_setclock(&cond, CLOCK_MONOTONIC);
+#else
+ pthread_condattr_setclock(&cond, CLOCK_REALTIME);
+#endif
ret = pthread_mutex_init(&mutex->lock, &attr);
if (ret) {
ret = pthread_mutex_init(&mutex->lock, &attr);
if (ret) {
struct timespec t;
int ret = 0;
struct timespec t;
int ret = 0;
+#ifdef FIO_HAVE_CLOCK_MONOTONIC
+ clock_gettime(CLOCK_MONOTONIC, &t);
+#else
clock_gettime(CLOCK_REALTIME, &t);
clock_gettime(CLOCK_REALTIME, &t);
t.tv_sec += seconds;
pthread_mutex_lock(&mutex->lock);
t.tv_sec += seconds;
pthread_mutex_lock(&mutex->lock);