Index: src/os_win.c ================================================================== --- src/os_win.c +++ src/os_win.c @@ -3629,19 +3629,20 @@ ** ** winShmEnterMutex() ** assert( winShmMutexHeld() ); ** winShmLeaveMutex() */ +static sqlite3_mutex *winBigLock = 0; static void winShmEnterMutex(void){ - sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_VFS1)); + sqlite3_mutex_enter(winBigLock); } static void winShmLeaveMutex(void){ - sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_VFS1)); + sqlite3_mutex_leave(winBigLock); } #ifndef NDEBUG static int winShmMutexHeld(void) { - return sqlite3_mutex_held(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_VFS1)); + return sqlite3_mutex_held(winBigLock); } #endif /* ** Object used to represent a single file opened and mmapped to provide @@ -6060,10 +6061,11 @@ #if defined(SQLITE_WIN32_HAS_WIDE) sqlite3_vfs_register(&winLongPathNolockVfs, 0); #endif + winBigLock = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_VFS1); return SQLITE_OK; } int sqlite3_os_end(void){ #if SQLITE_OS_WINRT @@ -6070,9 +6072,10 @@ if( sleepObj!=NULL ){ osCloseHandle(sleepObj); sleepObj = NULL; } #endif + winBigLock = 0; return SQLITE_OK; } #endif /* SQLITE_OS_WIN */