]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Allocation the mutex used by the Win32 VFS only once at initialization, instead of...
authormistachkin <mistachkin@noemail.net>
Mon, 5 Feb 2018 20:42:50 +0000 (20:42 +0000)
committermistachkin <mistachkin@noemail.net>
Mon, 5 Feb 2018 20:42:50 +0000 (20:42 +0000)
FossilOrigin-Name: 535ed0ac5e8728ec91fc0a4cb54b820923d161cfd4e0e6aed6df6cdae365bc7d

manifest
manifest.uuid
src/os_win.c

index 265850e6d94d7ba84e7c640ba3133cf08332fad2..5469fa43ad3368671edb3ad52606a14d8327d063 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Allocation\sthe\smutex\sused\sby\sthe\sunix\sVFS\sonly\sonce\sat\sinitialization,\sinstead\nof\severy\stime\sit\sis\sneeded.
-D 2018-02-05T16:39:12.754
+C Allocation\sthe\smutex\sused\sby\sthe\sWin32\sVFS\sonly\sonce\sat\sinitialization,\sinstead\sof\severy\stime\sit\sis\sneeded.
+D 2018-02-05T20:42:50.153
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F Makefile.in 7a3f714b4fcf793108042b7b0a5c720b0b310ec84314d61ba7f3f49f27e550ea
@@ -472,7 +472,7 @@ F src/os.h 48388821692e87da174ea198bf96b1b2d9d83be5dfc908f673ee21fafbe0d432
 F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
 F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
 F src/os_unix.c ce491421b3a54b63094a155eeac668a3bc8e5b86a5a58551d906e5b5affb443f
-F src/os_win.c 501dde1ee770f4ffa458bfe1cf376a556de3ab00bb8320d659c5984403991d62
+F src/os_win.c ca6b6a557b9015d9ecf77003482558b04bbbec86d5065af30e89295dfc01fbb7
 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
 F src/pager.c cd194a8793ce061e184ddc369fadbc1020c6f431014d22093f6c5e55c9234033
 F src/pager.h 581698f2177e8bd4008fe4760898ce20b6133d1df22139b9101b5155f900df7a
@@ -1704,7 +1704,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P ba0631de60ca38bf7efa6dbd86ec8774bf6f438c804155968e97f17eabe3b20a
-R 07658fd89f10e428329340f4fdba337c
-U drh
-Z f93cbf0dc0e4b2bfb043a63cd29cee7e
+P 5764dc160783f5c4017204b3e26a89d31240c868484ced8214c9ad872bd77bd4
+R 7ec707deb63ac6534c16562af3ea60e2
+U mistachkin
+Z 87b212ba57f1d2b4c01281b9a95b7258
index 2da9ca7d0a05bc9714b871726220f1fed57492d5..12329d932f3c81f1e5e6704e39552af656c0c682 100644 (file)
@@ -1 +1 @@
-5764dc160783f5c4017204b3e26a89d31240c868484ced8214c9ad872bd77bd4
\ No newline at end of file
+535ed0ac5e8728ec91fc0a4cb54b820923d161cfd4e0e6aed6df6cdae365bc7d
\ No newline at end of file
index 2b2b8ebd564e257407cacf4768ad286b130f194b..6132d321a1321708be4c9f1711dafc70d3b01730 100644 (file)
@@ -3631,15 +3631,16 @@ static SYSTEM_INFO winSysInfo;
 **     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
 
@@ -6062,6 +6063,7 @@ int sqlite3_os_init(void){
   sqlite3_vfs_register(&winLongPathNolockVfs, 0);
 #endif
 
+  winBigLock = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_VFS1);
   return SQLITE_OK;
 }
 
@@ -6072,6 +6074,7 @@ int sqlite3_os_end(void){
     sleepObj = NULL;
   }
 #endif
+  winBigLock = 0;
   return SQLITE_OK;
 }