diff options
author | drh <drh@noemail.net> | 2008-01-23 03:03:05 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-01-23 03:03:05 +0000 |
commit | 7e8b848a60a305231cca0b8cfc7f08be5f0429bd (patch) | |
tree | b413adb49b7ddd4166e6a878068fd15e1a25273e /src/os.c | |
parent | 4b2f9368cbbc9a26e8dcbcb87791267c10d14f50 (diff) | |
download | sqlite-7e8b848a60a305231cca0b8cfc7f08be5f0429bd.tar.gz sqlite-7e8b848a60a305231cca0b8cfc7f08be5f0429bd.zip |
Make sqlite3SafetyOn() and sqlite3SafetyOff() macros which disappear when
compiling without -DSQLITE_DEBUG=1. (CVS 4744)
FossilOrigin-Name: 5375ad6b4b652f388469b0ce4e8e78b3f49169bd
Diffstat (limited to 'src/os.c')
-rw-r--r-- | src/os.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -191,7 +191,9 @@ static sqlite3_vfs *vfsList = 0; ** first VFS on the list. */ sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){ +#ifndef SQLITE_MUTEX_NOOP sqlite3_mutex *mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER); +#endif sqlite3_vfs *pVfs = 0; static int isInit = 0; sqlite3_mutex_enter(mutex); @@ -233,7 +235,9 @@ static void vfsUnlink(sqlite3_vfs *pVfs){ ** true. */ int sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){ +#ifndef SQLITE_MUTEX_NOOP sqlite3_mutex *mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER); +#endif sqlite3_vfs_find(0); /* Make sure we are initialized */ sqlite3_mutex_enter(mutex); vfsUnlink(pVfs); @@ -253,7 +257,9 @@ int sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){ ** Unregister a VFS so that it is no longer accessible. */ int sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ +#ifndef SQLITE_MUTEX_NOOP sqlite3_mutex *mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MASTER); +#endif sqlite3_mutex_enter(mutex); vfsUnlink(pVfs); sqlite3_mutex_leave(mutex); |