]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Turn the _LOCK/_UNLOCK in xoshiro128** to no-op for non-threaded builds
authorOndřej Surý <ondrej@sury.org>
Wed, 30 May 2018 04:37:51 +0000 (06:37 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 30 May 2018 04:37:51 +0000 (06:37 +0200)
lib/isc/xoshiro128starstar.c

index e44b8c022e3b5df0e84cbf8c1eca50a3e4832ec1..a737bfd91c83d83a85629058003db2154bb87b56 100644 (file)
@@ -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 <windows.h>
 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));