mdbx: provide SRWL stub for Windows XP/2000.

Change-Id: I438373a4952298efc88ca4c1a92c88e173b82f98
This commit is contained in:
Leo Yuriev
2018-06-12 16:43:33 +03:00
parent 685abc7bcb
commit 9f2bf6a377
4 changed files with 124 additions and 7 deletions

View File

@@ -2003,7 +2003,7 @@ static int mdbx_mapresize(MDBX_env *env, const pgno_t size_pgno,
/* Acquire guard in exclusive mode for:
* - to avoid collision between read and write txns around env->me_dbgeo;
* - to avoid attachment of new reading threads (see mdbx_rdt_lock); */
AcquireSRWLockExclusive(&env->me_remap_guard);
mdbx_srwlock_AcquireExclusive(&env->me_remap_guard);
mdbx_handle_array_t *suspended = NULL;
mdbx_handle_array_t array_onstack;
int rc = MDBX_SUCCESS;
@@ -2083,7 +2083,7 @@ bailout:
#if defined(_WIN32) || defined(_WIN64)
int err = MDBX_SUCCESS;
ReleaseSRWLockExclusive(&env->me_remap_guard);
mdbx_srwlock_ReleaseExclusive(&env->me_remap_guard);
if (suspended) {
err = mdbx_resume_threads_after_remap(suspended);
if (suspended != &array_onstack)
@@ -4912,7 +4912,7 @@ int __cold mdbx_env_create(MDBX_env **penv) {
goto bailout;
#if defined(_WIN32) || defined(_WIN64)
InitializeSRWLock(&env->me_remap_guard);
mdbx_srwlock_Init(&env->me_remap_guard);
InitializeCriticalSection(&env->me_windowsbug_lock);
#else
rc = mdbx_fastmutex_init(&env->me_remap_guard);