mdbx-windows: fix srw-release if rdt-lock failed (minor/paranoia).

This commit is contained in:
Leo Yuriev 2018-04-12 00:56:38 +03:00
parent 159d676429
commit d127c28e83

View File

@ -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) {