On some systems MONOTONIC still causes a hang.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
} else {
struct timespec ts;
- if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0) {
+ if (clock_gettime(CLOCK_REALTIME, &ts) < 0) {
clock_gettime_works = 0;
goto gtod;
}
pthread_condattr_init(&cond);
pthread_condattr_setpshared(&cond, mflag);
- pthread_condattr_setclock(&cond, CLOCK_MONOTONIC);
pthread_cond_init(&mutex->cond, &cond);
ret = pthread_mutex_init(&mutex->lock, &attr);
struct timespec t;
int ret = 0;
- clock_gettime(CLOCK_MONOTONIC, &t);
+ clock_gettime(CLOCK_REALTIME, &t);
t.tv_sec += seconds;
pthread_mutex_lock(&mutex->lock);