-C Reverted\sprevious\scheckin\s(on\ssecond\sthought,\schanging\scase\scould\sbreak\sbadly\swritten\shomegrown\sparsers\ssuch\sas\ssometimes\sencountered\sin\sembedded\sfirmware.)\s(CVS\s5289)
-D 2008-06-23T21:26:05
+C Update\sOS/2\smutex\simplementation:\smake\smethods\sstatic\sand\sdon't\suse\sthem\sby\sthe\sold\snames\sany\smore.\sHeld/Notheld\sshould\sbe\sdebug\sonly.\s(CVS\s5290)
+D 2008-06-23T22:13:28
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in ff6f90048555a0088f6a4b7406bed5e55a7c4eff
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/mem5.c ad31a0a481b86b86f4ac0b6d952e69727d4e113a
F src/mutex.c a485a0eac8ee2cd95f66e565b4c6696c18db968f
F src/mutex.h 236677b27760d85701b5872d01b5cafedde5f0a9
-F src/mutex_os2.c 7c948174d31e06df3e3dd0ef734691e95e30a5f4
+F src/mutex_os2.c 9c5637aa4c307c552566d0f0b3bd206245b54a97
F src/mutex_unix.c c1526811f4b97a7cd9d4d72d2b9623d06abd05ce
F src/mutex_w32.c 7aa9ad79b36931314b81ac4045f40f2c503b1e44
F src/os.c b1c73547466b832612b3be425a8f21afd603fd9b
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P e07ed82caf5e4706ef564271830112d31e8cff7c
-R f38fb3594a0085ca5a3991f47a016d0f
-U mihailim
-Z 0dc42af4c4695aef69f105f585f6e11c
+P bf2e283d6fd40cabe55864b06b502524eb8a3b07
+R bfadbc404a2d8b31ffee6a81899b30a6
+U pweilbacher
+Z 4ec4b9feb6cdd59c7ef6420f4a9a5810
*************************************************************************
** This file contains the C functions that implement mutexes for OS/2
**
-** $Id: mutex_os2.c,v 1.9 2008/06/19 08:51:24 danielk1977 Exp $
+** $Id: mutex_os2.c,v 1.10 2008/06/23 22:13:28 pweilbacher Exp $
*/
#include "sqliteInt.h"
/*
** Initialize and deinitialize the mutex subsystem.
*/
-int os2MutexInit(void){ return SQLITE_OK; }
-int os2MutexEnd(void){ return SQLITE_OK; }
+static int os2MutexInit(void){ return SQLITE_OK; }
+static int os2MutexEnd(void){ return SQLITE_OK; }
/*
** The sqlite3_mutex_alloc() routine allocates a new
** mutex types, the same mutex is returned on every call that has
** the same type number.
*/
-sqlite3_mutex *os2MutexAlloc(int iType){
+static sqlite3_mutex *os2MutexAlloc(int iType){
sqlite3_mutex *p = NULL;
switch( iType ){
case SQLITE_MUTEX_FAST:
** This routine deallocates a previously allocated mutex.
** SQLite is careful to deallocate every mutex that it allocates.
*/
-void os2MutexFree(sqlite3_mutex *p){
+static void os2MutexFree(sqlite3_mutex *p){
if( p==0 ) return;
assert( p->nRef==0 );
assert( p->id==SQLITE_MUTEX_FAST || p->id==SQLITE_MUTEX_RECURSIVE );
** can enter. If the same thread tries to enter any other kind of mutex
** more than once, the behavior is undefined.
*/
-void os2MutexEnter(sqlite3_mutex *p){
+static void os2MutexEnter(sqlite3_mutex *p){
TID tid;
PID holder1;
ULONG holder2;
if( p==0 ) return;
- assert( p->id==SQLITE_MUTEX_RECURSIVE || sqlite3_mutex_notheld(p) );
+ assert( p->id==SQLITE_MUTEX_RECURSIVE || os2MutexNotheld(p) );
DosRequestMutexSem(p->mutex, SEM_INDEFINITE_WAIT);
DosQueryMutexSem(p->mutex, &holder1, &tid, &holder2);
p->owner = tid;
p->nRef++;
}
-int os2MutexTry(sqlite3_mutex *p){
+static int os2MutexTry(sqlite3_mutex *p){
int rc;
TID tid;
PID holder1;
ULONG holder2;
if( p==0 ) return SQLITE_OK;
- assert( p->id==SQLITE_MUTEX_RECURSIVE || sqlite3_mutex_notheld(p) );
+ assert( p->id==SQLITE_MUTEX_RECURSIVE || os2MutexNotheld(p) );
if( DosRequestMutexSem(p->mutex, SEM_IMMEDIATE_RETURN) == NO_ERROR) {
DosQueryMutexSem(p->mutex, &holder1, &tid, &holder2);
p->owner = tid;
** is undefined if the mutex is not currently entered or
** is not currently allocated. SQLite will never do either.
*/
-void os2MutexLeave(sqlite3_mutex *p){
+static void os2MutexLeave(sqlite3_mutex *p){
TID tid;
PID holder1;
ULONG holder2;
DosReleaseMutexSem(p->mutex);
}
+#ifdef SQLITE_DEBUG
/*
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
** intended for use inside assert() statements.
*/
-int os2MutexHeld(sqlite3_mutex *p){
+static int os2MutexHeld(sqlite3_mutex *p){
TID tid;
PID pid;
ULONG ulCount;
}
return p==0 || (p->nRef!=0 && p->owner==tid);
}
-int os2MutexNotheld(sqlite3_mutex *p){
+static int os2MutexNotheld(sqlite3_mutex *p){
TID tid;
PID pid;
ULONG ulCount;
}
return p==0 || p->nRef==0 || p->owner!=tid;
}
+#endif
sqlite3_mutex_methods *sqlite3DefaultMutex(void){
static sqlite3_mutex_methods sMutex = {
os2MutexEnter,
os2MutexTry,
os2MutexLeave,
-
+#ifdef SQLITE_DEBUG
os2MutexHeld,
os2MutexNotheld
+#endif
};
return &sMutex;