| Index: third_party/sqlite/src/src/mutex_os2.c
|
| diff --git a/third_party/sqlite/src/src/mutex_os2.c b/third_party/sqlite/src/src/mutex_os2.c
|
| index 15ffd2c9f3b2fbdf2cf4b5e32a7fd681c0001964..4438c097c49614f41bd977eb48ff82afcfdbd743 100644
|
| --- a/third_party/sqlite/src/src/mutex_os2.c
|
| +++ b/third_party/sqlite/src/src/mutex_os2.c
|
| @@ -10,8 +10,6 @@
|
| **
|
| *************************************************************************
|
| ** This file contains the C functions that implement mutexes for OS/2
|
| -**
|
| -** $Id: mutex_os2.c,v 1.11 2008/11/22 19:50:54 pweilbacher Exp $
|
| */
|
| #include "sqliteInt.h"
|
|
|
| @@ -160,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,
|
| @@ -220,41 +251,8 @@ 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 = {
|
| +sqlite3_mutex_methods const *sqlite3DefaultMutex(void){
|
| + static const sqlite3_mutex_methods sMutex = {
|
| os2MutexInit,
|
| os2MutexEnd,
|
| os2MutexAlloc,
|
|
|