]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add runtime check on top of pthread_mutex_{lock,unlock} in rng
authorWitold Kręcicki <wpk@isc.org>
Sat, 25 Aug 2018 11:25:51 +0000 (13:25 +0200)
committerWitold Kręcicki <wpk@isc.org>
Sat, 25 Aug 2018 11:26:25 +0000 (13:26 +0200)
lib/isc/xoshiro128starstar.c

index 9df1b4ba74d3013df14a43886c3808435ea3903e..bc08e6740f2e08b66b28db65002fde1f9ff04057 100644 (file)
@@ -74,8 +74,8 @@ static volatile HANDLE _mutex = NULL;
 
 #include <pthread.h>
 static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER;
-#define _LOCK()   pthread_mutex_lock(&_mutex)
-#define _UNLOCK() pthread_mutex_unlock(&_mutex)
+#define _LOCK()   RUNTIME_CHECK(pthread_mutex_lock(&_mutex)==0)
+#define _UNLOCK() RUNTIME_CHECK(pthread_mutex_unlock(&_mutex)==0)
 #endif /* defined(_WIN32) || defined(_WIN64) */
 
 static uint32_t seed[4];