1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Move the sqlite3SharedCacheEnabled global and the inProgress static variable (function sqlite3_initialize()) into the global sqlite3Config structure. This is required for the OMIT_WSD feature to work on some platforms. (CVS 5662)

FossilOrigin-Name: 88c82759946910b5ffdd5febc17356403f986c2e
This commit is contained in:
danielk1977
2008-09-02 14:07:24 +00:00
parent 263ac19474
commit 502b4e00c6
6 changed files with 26 additions and 29 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.496 2008/09/02 09:38:07 danielk1977 Exp $
** $Id: main.c,v 1.497 2008/09/02 14:07:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -85,7 +85,6 @@ char *sqlite3_temp_directory = 0;
** without blocking.
*/
int sqlite3_initialize(void){
SQLITE_WSD static int inProgress = 0; /* Prevent recursion */
sqlite3_mutex *pMaster; /* The main static mutex */
int rc; /* Result code */
@@ -152,9 +151,9 @@ int sqlite3_initialize(void){
** recursive calls might also be possible.
*/
sqlite3_mutex_enter(sqlite3GlobalConfig.pInitMutex);
if( sqlite3GlobalConfig.isInit==0 && GLOBAL(int, inProgress)==0 ){
if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){
FuncDefHash *pHash = &GLOBAL(FuncDefHash, sqlite3GlobalFunctions);
GLOBAL(int, inProgress) = 1;
sqlite3GlobalConfig.inProgress = 1;
memset(pHash, 0, sizeof(sqlite3GlobalFunctions));
sqlite3RegisterGlobalFunctions();
rc = sqlite3_os_init();
@@ -163,7 +162,7 @@ int sqlite3_initialize(void){
sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage,
sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
}
GLOBAL(int, inProgress) = 0;
sqlite3GlobalConfig.inProgress = 0;
sqlite3GlobalConfig.isInit = (rc==SQLITE_OK ? 1 : 0);
}
sqlite3_mutex_leave(sqlite3GlobalConfig.pInitMutex);