diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mutex_unix.c | 5 | ||||
-rw-r--r-- | src/mutex_w32.c | 9 | ||||
-rw-r--r-- | src/os.c | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/src/mutex_unix.c b/src/mutex_unix.c index 55c3929be..5288ae42f 100644 --- a/src/mutex_unix.c +++ b/src/mutex_unix.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains the C functions that implement mutexes for pthreads ** -** $Id: mutex_unix.c,v 1.11 2008/06/19 08:51:24 danielk1977 Exp $ +** $Id: mutex_unix.c,v 1.12 2008/06/19 16:07:07 drh Exp $ */ #include "sqliteInt.h" @@ -313,9 +313,10 @@ sqlite3_mutex_methods *sqlite3DefaultMutex(void){ pthreadMutexEnter, pthreadMutexTry, pthreadMutexLeave, - +#ifdef SQLITE_DEBUG pthreadMutexHeld, pthreadMutexNotheld +#endif }; return &sMutex; diff --git a/src/mutex_w32.c b/src/mutex_w32.c index 22b58111d..83e094247 100644 --- a/src/mutex_w32.c +++ b/src/mutex_w32.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains the C functions that implement mutexes for win32 ** -** $Id: mutex_w32.c,v 1.9 2008/06/19 08:51:24 danielk1977 Exp $ +** $Id: mutex_w32.c,v 1.10 2008/06/19 16:07:07 drh Exp $ */ #include "sqliteInt.h" @@ -57,6 +57,8 @@ struct sqlite3_mutex { } #endif /* OS_WINCE */ + +#ifdef SQLITE_DEBUG /* ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are ** intended for use only inside assert() statements. @@ -67,6 +69,7 @@ static int winMutexHeld(sqlite3_mutex *p){ static int winMutexNotheld(sqlite3_mutex *p){ return p->nRef==0 || p->owner!=GetCurrentThreadId(); } +#endif /* @@ -230,12 +233,12 @@ sqlite3_mutex_methods *sqlite3DefaultMutex(void){ winMutexEnter, winMutexTry, winMutexLeave, - +#ifdef SQLITE_DEBUG winMutexHeld, winMutexNotheld +#endif }; return &sMutex; } #endif /* SQLITE_MUTEX_W32 */ - @@ -13,7 +13,7 @@ ** This file contains OS interface code that is common to all ** architectures. ** -** $Id: os.c,v 1.114 2008/06/18 17:09:10 danielk1977 Exp $ +** $Id: os.c,v 1.115 2008/06/19 16:07:07 drh Exp $ */ #define _SQLITE_OS_C_ 1 #include "sqliteInt.h" @@ -199,6 +199,8 @@ static sqlite3_vfs *vfsList = 0; ** first VFS on the list. */ sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){ + sqlite3_vfs *pVfs = 0; + static int isInit = 0; #ifndef SQLITE_MUTEX_NOOP sqlite3_mutex *mutex; #endif @@ -209,8 +211,6 @@ sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){ #ifndef SQLITE_MUTEX_NOOP mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); #endif - sqlite3_vfs *pVfs = 0; - static int isInit = 0; sqlite3_mutex_enter(mutex); if( !isInit ){ vfsList = sqlite3OsDefaultVfs(); |