aboutsummaryrefslogtreecommitdiff
path: root/src/os.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-01-23 03:03:05 +0000
committerdrh <drh@noemail.net>2008-01-23 03:03:05 +0000
commit7e8b848a60a305231cca0b8cfc7f08be5f0429bd (patch)
treeb413adb49b7ddd4166e6a878068fd15e1a25273e /src/os.c
parent4b2f9368cbbc9a26e8dcbcb87791267c10d14f50 (diff)
downloadsqlite-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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/os.c b/src/os.c
index 71284cd90..57e2d0fdd 100644
--- a/src/os.c
+++ b/src/os.c
@@ -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);