From: Tobias Brunner Date: Wed, 1 Apr 2020 08:17:27 +0000 (+0200) Subject: mutex: Don't use ...timedwait_monotonic() if clock is set via attribute X-Git-Tag: 5.9.0dr1~9^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b93510dace6b1e46dacc24525868362b7c9f32c;p=thirdparty%2Fstrongswan.git mutex: Don't use ...timedwait_monotonic() if clock is set via attribute This allows using clocks other than CLOCK_MONOTONIC. --- diff --git a/src/libstrongswan/threading/mutex.c b/src/libstrongswan/threading/mutex.c index c54f661b51..70db30f218 100644 --- a/src/libstrongswan/threading/mutex.c +++ b/src/libstrongswan/threading/mutex.c @@ -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