From e0fcd6e0ec16db0353e095510758fac4abfed2b8 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Thu, 2 Aug 2018 18:36:45 +0300 Subject: [PATCH] mdbx: add PTHREAD_MUTEX_ERRORCHECK for shared mutexes. Change-Id: Ib9520b6bc68b294088298b1901278fab824ea43e --- src/lck-posix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lck-posix.c b/src/lck-posix.c index ce94e1e1..0aa9d850 100644 --- a/src/lck-posix.c +++ b/src/lck-posix.c @@ -156,6 +156,10 @@ int __cold mdbx_lck_init(MDBX_env *env) { goto bailout; #endif /* PTHREAD_PRIO_INHERIT */ + rc = pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_ERRORCHECK); + if (rc) + goto bailout; + rc = pthread_mutex_init(&env->me_lck->mti_rmutex, &ma); if (rc) goto bailout;