mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 22:32:07 -04:00
Turn the _LOCK/_UNLOCK in xoshiro128** to no-op for non-threaded builds
This commit is contained in:
parent
28e0b2c4c4
commit
12bdee3aa7
1 changed files with 5 additions and 1 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue