Skip to content

Instantly share code, notes, and snippets.

@vinterstum
Created January 29, 2020 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinterstum/ff4bc1ea715cc1d4c5da45864c9de4af to your computer and use it in GitHub Desktop.
Save vinterstum/ff4bc1ea715cc1d4c5da45864c9de4af to your computer and use it in GitHub Desktop.
diff --git a/sqlite/src/sqlite3.c b/sqlite/src/sqlite3.c
--- a/sqlite/src/sqlite3.c
+++ b/sqlite/src/sqlite3.c
@@ -25165,6 +25165,7 @@ SQLITE_PRIVATE int sqlite3MutexInit(void
GLOBAL(int, mutexIsInit) = 1;
#endif
+ sqlite3MemoryBarrier();
return rc;
}
@@ -155363,7 +155364,10 @@ SQLITE_API int sqlite3_initialize(void){
** must be complete. So isInit must not be set until the very end
** of this routine.
*/
- if( sqlite3GlobalConfig.isInit ) return SQLITE_OK;
+ if( sqlite3GlobalConfig.isInit ) {
+ sqlite3MemoryBarrier();
+ return SQLITE_OK;
+ }
/* Make sure the mutex subsystem is initialized. If unable to
** initialize the mutex subsystem, return early with the error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment