From d127c28e83110a28eb8b26144f9986e480ef1b45 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Thu, 12 Apr 2018 00:56:38 +0300 Subject: [PATCH] mdbx-windows: fix srw-release if rdt-lock failed (minor/paranoia). --- src/lck-windows.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lck-windows.c b/src/lck-windows.c index 683ea056..67e989ae 100644 --- a/src/lck-windows.c +++ b/src/lck-windows.c @@ -162,7 +162,10 @@ int mdbx_rdt_lock(MDBX_env *env) { /* transite from S-? (used) to S-E (locked), e.g. exclusive lock upper-part */ if (flock(env->me_lfd, LCK_EXCLUSIVE | LCK_WAITFOR, LCK_UPPER)) return MDBX_SUCCESS; - return GetLastError(); + + int rc = GetLastError(); + ReleaseSRWLockShared(&env->me_remap_guard); + return rc; } void mdbx_rdt_unlock(MDBX_env *env) {