mdbx: fix/rework exclusive-locking for Windows.

Change-Id: I1b129a10ed7523024481480647317f1643f2ea70
This commit is contained in:
Leonid Yuriev
2017-07-19 09:12:46 +03:00
committed by Leo Yuriev
parent 17e8429a29
commit c8a5df650b
4 changed files with 43 additions and 26 deletions

View File

@@ -91,7 +91,9 @@ static __inline int mdbx_lck_shared(int lfd) {
return mdbx_lck_op(lfd, F_SETLKW, F_RDLCK, 0, 1);
}
int mdbx_lck_downgrade(MDBX_env *env) { return mdbx_lck_shared(env->me_lfd); }
int mdbx_lck_downgrade(MDBX_env *env, bool complete) {
return complete ? mdbx_lck_shared(env->me_lfd) : MDBX_SUCCESS;
}
int mdbx_lck_upgrade(MDBX_env *env) { return mdbx_lck_exclusive(env->me_lfd); }