aboutsummaryrefslogtreecommitdiff
path: root/src/mutex_os2.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-12-01 14:31:18 +0000
committerdrh <drh@noemail.net>2009-12-01 14:31:18 +0000
commitcfa35664a57019ba559fc4448aa1a6cf6fe511f9 (patch)
treeb24dfa1e3a97684ffa417169ee88d82b6d18e5eb /src/mutex_os2.c
parent65e8c82e1a25c6edc0dd6f6823b2a2967501c7c2 (diff)
downloadsqlite-cfa35664a57019ba559fc4448aa1a6cf6fe511f9.tar.gz
sqlite-cfa35664a57019ba559fc4448aa1a6cf6fe511f9.zip
Reorder function declarations in mutex_os2.c. This is a blind change - we
have no capability of testing on OS/2. Ticket [97214a34d814] FossilOrigin-Name: c40e4ef094bb9d58f14354602785ccc228f8bc2a
Diffstat (limited to 'src/mutex_os2.c')
-rw-r--r--src/mutex_os2.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/mutex_os2.c b/src/mutex_os2.c
index 9faf4e190..f16dc218d 100644
--- a/src/mutex_os2.c
+++ b/src/mutex_os2.c
@@ -158,6 +158,39 @@ static void os2MutexFree(sqlite3_mutex *p){
sqlite3_free( p );
}
+#ifdef SQLITE_DEBUG
+/*
+** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
+** intended for use inside assert() statements.
+*/
+static int os2MutexHeld(sqlite3_mutex *p){
+ TID tid;
+ PID pid;
+ ULONG ulCount;
+ PTIB ptib;
+ if( p!=0 ) {
+ DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount);
+ } else {
+ DosGetInfoBlocks(&ptib, NULL);
+ tid = ptib->tib_ptib2->tib2_ultid;
+ }
+ return p==0 || (p->nRef!=0 && p->owner==tid);
+}
+static int os2MutexNotheld(sqlite3_mutex *p){
+ TID tid;
+ PID pid;
+ ULONG ulCount;
+ PTIB ptib;
+ if( p!= 0 ) {
+ DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount);
+ } else {
+ DosGetInfoBlocks(&ptib, NULL);
+ tid = ptib->tib_ptib2->tib2_ultid;
+ }
+ return p==0 || p->nRef==0 || p->owner!=tid;
+}
+#endif
+
/*
** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
** to enter a mutex. If another thread is already within the mutex,
@@ -218,39 +251,6 @@ static void os2MutexLeave(sqlite3_mutex *p){
DosReleaseMutexSem(p->mutex);
}
-#ifdef SQLITE_DEBUG
-/*
-** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
-** intended for use inside assert() statements.
-*/
-static int os2MutexHeld(sqlite3_mutex *p){
- TID tid;
- PID pid;
- ULONG ulCount;
- PTIB ptib;
- if( p!=0 ) {
- DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount);
- } else {
- DosGetInfoBlocks(&ptib, NULL);
- tid = ptib->tib_ptib2->tib2_ultid;
- }
- return p==0 || (p->nRef!=0 && p->owner==tid);
-}
-static int os2MutexNotheld(sqlite3_mutex *p){
- TID tid;
- PID pid;
- ULONG ulCount;
- PTIB ptib;
- if( p!= 0 ) {
- DosQueryMutexSem(p->mutex, &pid, &tid, &ulCount);
- } else {
- DosGetInfoBlocks(&ptib, NULL);
- tid = ptib->tib_ptib2->tib2_ultid;
- }
- return p==0 || p->nRef==0 || p->owner!=tid;
-}
-#endif
-
sqlite3_mutex_methods *sqlite3DefaultMutex(void){
static sqlite3_mutex_methods sMutex = {
os2MutexInit,