zbd: avoid initializing swd when unnecessary
[fio.git] / pshared.c
index 74812ede35ecc0ecf51f09b9c3a444ca4563110c..211925564b9fb543e4edf1d4c6a26df4bd60db21 100644 (file)
--- a/pshared.c
+++ b/pshared.c
@@ -21,6 +21,15 @@ int cond_init_pshared(pthread_cond_t *cond)
                return ret;
        }
 #endif
+
+#ifdef CONFIG_PTHREAD_CONDATTR_SETCLOCK
+       ret = pthread_condattr_setclock(&cattr, CLOCK_MONOTONIC);
+       if (ret) {
+               log_err("pthread_condattr_setclock: %s\n", strerror(ret));
+               return ret;
+       }
+#endif
+
        ret = pthread_cond_init(cond, &cattr);
        if (ret) {
                log_err("pthread_cond_init: %s\n", strerror(ret));