diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mutex_w32.c | 9 | ||||
-rw-r--r-- | src/sqlite.h.in | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/mutex_w32.c b/src/mutex_w32.c index ffadd8d81..0c2e08db1 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.2 2007/08/30 14:10:30 drh Exp $ +** $Id: mutex_w32.c,v 1.3 2007/09/04 22:31:37 drh Exp $ */ #include "sqliteInt.h" @@ -141,6 +141,12 @@ void sqlite3_mutex_enter(sqlite3_mutex *p){ p->nRef++; } int sqlite3_mutex_try(sqlite3_mutex *p){ + /* The TryEnterCriticalSection() interface is not available on all + ** windows systems. Since sqlite3_mutex_try() is only used as an + ** optimization, we can skip it on windows. */ + return SQLITE_BUSY; + +#if 0 /* Not Available */ int rc; assert( p ); assert( p->id==SQLITE_MUTEX_RECURSIVE || sqlite3_mutex_notheld(p) ); @@ -152,6 +158,7 @@ int sqlite3_mutex_try(sqlite3_mutex *p){ rc = SQLITE_BUSY; } return rc; +#endif } /* diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 6c035de53..db0ffb19d 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -30,7 +30,7 @@ ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. ** -** @(#) $Id: sqlite.h.in,v 1.258 2007/09/04 12:18:42 drh Exp $ +** @(#) $Id: sqlite.h.in,v 1.259 2007/09/04 22:31:37 drh Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ @@ -3432,6 +3432,11 @@ int sqlite3_vfs_unregister(sqlite3_vfs*); ** more than once, the behavior is undefined. SQLite will never exhibit ** such behavior in its own use of mutexes. ** +** Some systems (ex: windows95) do not the operation implemented by +** sqlite3_mutex_try(). On those systems, sqlite3_mutex_try() will +** always return SQLITE_BUSY. The SQLite core only ever uses +** sqlite3_mutex_try() as an optimization so this is acceptable behavior. +** ** The sqlite3_mutex_leave() routine exits a mutex that was ** previously entered by the same thread. The behavior ** is undefined if the mutex is not currently entered by the |