mirror of
https://github.com/isar/libmdbx.git
synced 2025-10-23 12:08:56 +08:00
mdbx: provide SRWL stub for Windows XP/2000.
Change-Id: I438373a4952298efc88ca4c1a92c88e173b82f98
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user