From 8b93510dace6b1e46dacc24525868362b7c9f32c Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 1 Apr 2020 10:17:27 +0200 Subject: [PATCH] mutex: Don't use ...timedwait_monotonic() if clock is set via attribute This allows using clocks other than CLOCK_MONOTONIC. --- src/libstrongswan/threading/mutex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstrongswan/threading/mutex.c b/src/libstrongswan/threading/mutex.c index c54f661b5..70db30f21 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