1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Revise the implementation of sqlite3_initialize() slightly in order to make

it more easily testable.  The functionality should be unchanged. (CVS 6519)

FossilOrigin-Name: bb1a390a3d2f79b27e3ec2514ae00f5b22dbfb06
This commit is contained in:
drh
2009-04-17 16:54:22 +00:00
parent 52e2c35fb2
commit 0bf9f7bca4
3 changed files with 13 additions and 11 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.536 2009/04/09 01:23:49 drh Exp $
** $Id: main.c,v 1.537 2009/04/17 16:54:23 drh Exp $
*/
#include "sqliteInt.h"
@@ -162,14 +162,16 @@ int sqlite3_initialize(void){
sqlite3GlobalConfig.inProgress = 1;
memset(pHash, 0, sizeof(sqlite3GlobalFunctions));
sqlite3RegisterGlobalFunctions();
rc = sqlite3_os_init();
rc = sqlite3PcacheInitialize();
if( rc==SQLITE_OK ){
rc = sqlite3_os_init();
}
if( rc==SQLITE_OK ){
rc = sqlite3PcacheInitialize();
sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage,
sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
sqlite3GlobalConfig.isInit = 1;
}
sqlite3GlobalConfig.inProgress = 0;
sqlite3GlobalConfig.isInit = (rc==SQLITE_OK ? 1 : 0);
}
sqlite3_mutex_leave(sqlite3GlobalConfig.pInitMutex);