/* ** 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. If a NULL pointer is passed as an argument ** this function is a no-op. */ static void sqlite3_mutex_leave( sqlite3_mutex p ) { if ( p != null ) { sqlite3GlobalConfig.mutex.xMutexLeave( p ); } }
static bool sqlite3_mutex_notheld( sqlite3_mutex p ) { return ( p == null || sqlite3GlobalConfig.mutex.xMutexNotheld( p ) != 0 ) ; }
/* ** Obtain the mutex p. If some other thread already has the mutex, block ** until it can be obtained. */ static void sqlite3_mutex_enter( sqlite3_mutex p ) { if ( p != null ) { sqlite3GlobalConfig.mutex.xMutexEnter( p ); } }
/* ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY. */ static int sqlite3_mutex_try( sqlite3_mutex p ) { int rc = SQLITE_OK; if ( p != null ) { return sqlite3GlobalConfig.mutex.xMutexTry( p ); } return rc; }
static void noopMutexLeave(sqlite3_mutex *p){ return; }
/* ** Free a dynamic mutex. */ static void sqlite3_mutex_free( ref sqlite3_mutex p ) { if ( p != null ) { sqlite3GlobalConfig.mutex.xMutexFree( p ); } }
static int noopMutexTry(sqlite3_mutex *p){ return SQLITE_OK; }
static void noopMutexEnter(sqlite3_mutex *p){ return; }
static void noopMutexFree(sqlite3_mutex *p){ return; }
static int noopMutexNotheld(sqlite3_mutex *p){ return 1; }
public Mem0Global( int nScratchFree, int nPageFree, sqlite3_mutex mutex, sqlite3_int64 alarmThreshold, dxalarmCallback alarmCallback, object alarmArg, int alarmBusy, int[] aScratchFree, int[] aPageFree ) { this.nScratchFree = nScratchFree; this.nPageFree = nPageFree; this.mutex = mutex; this.alarmThreshold = alarmThreshold; this.alarmCallback = alarmCallback; this.alarmArg = alarmArg; this.alarmBusy = alarmBusy; this.aScratchFree = aScratchFree; this.aPageFree = aPageFree; }