From: Ondřej Surý Date: Wed, 30 May 2018 04:37:51 +0000 (+0200) Subject: Turn the _LOCK/_UNLOCK in xoshiro128** to no-op for non-threaded builds X-Git-Tag: v9.13.1~21^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12bdee3aa7bd3af19af9c527957e9b754feb2894;p=thirdparty%2Fbind9.git Turn the _LOCK/_UNLOCK in xoshiro128** to no-op for non-threaded builds --- diff --git a/lib/isc/xoshiro128starstar.c b/lib/isc/xoshiro128starstar.c index e44b8c022e3..a737bfd91c8 100644 --- a/lib/isc/xoshiro128starstar.c +++ b/lib/isc/xoshiro128starstar.c @@ -34,7 +34,7 @@ * * The state must be seeded so that it is not everywhere zero. */ - +#if defined(ISC_PLATFORM_USETHREADS) #if defined(_WIN32) || defined(_WIN64) #include static volatile HANDLE _mutex = NULL; @@ -62,6 +62,10 @@ static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER; #define _LOCK() pthread_mutex_lock(&_mutex) #define _UNLOCK() pthread_mutex_unlock(&_mutex) #endif /* defined(_WIN32) || defined(_WIN64) */ +#else /* defined(ISC_PLATFORM_USETHREADS) */ +#define _LOCK() +#define _UNLOCK() +#endif static inline isc_uint32_t rotl(const isc_uint32_t x, int k) { return (x << k) | (x >> (32 - k));