mutex: Don't use ...timedwait_monotonic() if clock is set via attribute

This allows using clocks other than CLOCK_MONOTONIC.
This commit is contained in:
Tobias Brunner
2020-06-02 13:57:37 +02:00
parent 6b3bf7cdac
commit 8b93510dac
+2 -1
View File
@@ -239,7 +239,8 @@ METHOD(condvar_t, wait_, void,
}
/* use the monotonic clock based version of this function if available */
#ifdef HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC
#if defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC) && \
!defined(HAVE_CONDATTR_CLOCK_MONOTONIC)
#define pthread_cond_timedwait pthread_cond_timedwait_monotonic
#endif