1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Progress toward implementation of sqlite3_config() and a rework of the

mutex and memory allocation subsystems.  This is an incremental check-in. (CVS 5218)

FossilOrigin-Name: a03c5af115889f477e17187a198a7d2d40bc76bf
This commit is contained in:
drh
2008-06-13 18:24:27 +00:00
parent 655194d6ae
commit 40257ffd0a
26 changed files with 453 additions and 155 deletions

View File

@@ -13,7 +13,7 @@
** This file contains OS interface code that is common to all
** architectures.
**
** $Id: os.c,v 1.111 2008/06/06 11:11:26 danielk1977 Exp $
** $Id: os.c,v 1.112 2008/06/13 18:24:27 drh Exp $
*/
#define _SQLITE_OS_C_ 1
#include "sqliteInt.h"
@@ -200,7 +200,14 @@ static sqlite3_vfs *vfsList = 0;
*/
sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){
#ifndef SQLITE_MUTEX_NOOP
sqlite3_mutex *mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER);
sqlite3_mutex *mutex;
#endif
#ifndef SQLITE_OMIT_AUTOINIT
int rc = sqlite3_initialize();
if( rc ) return 0;
#endif
#ifndef SQLITE_MUTEX_NOOP
mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER);
#endif
sqlite3_vfs *pVfs = 0;
static int isInit = 0;
@@ -244,7 +251,14 @@ static void vfsUnlink(sqlite3_vfs *pVfs){
*/
int sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){
#ifndef SQLITE_MUTEX_NOOP
sqlite3_mutex *mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER);
sqlite3_mutex *mutex;
#endif
#ifndef SQLITE_OMIT_AUTOINIT
int rc = sqlite3_initialize();
if( rc ) return rc;
#endif
#ifndef SQLITE_MUTEX_NOOP
mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER);
#endif
sqlite3_vfs_find(0); /* Make sure we are initialized */
sqlite3_mutex_enter(mutex);