]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
mutex: Don't use ...timedwait_monotonic() if clock is set via attribute
authorTobias Brunner <tobias@strongswan.org>
Wed, 1 Apr 2020 08:17:27 +0000 (10:17 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 2 Jun 2020 11:57:37 +0000 (13:57 +0200)
This allows using clocks other than CLOCK_MONOTONIC.

src/libstrongswan/threading/mutex.c

index c54f661b51ec5998695281846faaf4a223765404..70db30f218c1481b596dc52ce12a37997b383a52 100644 (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