private RC pager_wait_on_lock(VFSLOCK locktype) { // Check that this is either a no-op (because the requested lock is already held, or one of the transistions that the busy-handler // may be invoked during, according to the comment above sqlite3PagerSetBusyhandler(). Debug.Assert((this.eLock >= locktype) || (this.eLock == VFSLOCK.NO && locktype == VFSLOCK.SHARED) || (this.eLock == VFSLOCK.RESERVED && locktype == VFSLOCK.EXCLUSIVE)); RC rc; do { rc = pagerLockDb(locktype); }while (rc == RC.BUSY && this.xBusyHandler(this.pBusyHandlerArg) != 0); return(rc); }
private RC pagerLockDb(VFSLOCK eLock) { var rc = RC.OK; Debug.Assert(eLock == VFSLOCK.SHARED || eLock == VFSLOCK.RESERVED || eLock == VFSLOCK.EXCLUSIVE); if (this.eLock < eLock || this.eLock == VFSLOCK.UNKNOWN) { rc = this.fd.Lock(eLock); if (rc == RC.OK && (this.eLock != VFSLOCK.UNKNOWN || eLock == VFSLOCK.EXCLUSIVE)) { this.eLock = eLock; SysEx.IOTRACE("LOCK {0:x} {1}", this.GetHashCode(), eLock); } } return rc; }
private RC pagerLockDb(VFSLOCK eLock) { var rc = RC.OK; Debug.Assert(eLock == VFSLOCK.SHARED || eLock == VFSLOCK.RESERVED || eLock == VFSLOCK.EXCLUSIVE); if (this.eLock < eLock || this.eLock == VFSLOCK.UNKNOWN) { rc = this.fd.Lock(eLock); if (rc == RC.OK && (this.eLock != VFSLOCK.UNKNOWN || eLock == VFSLOCK.EXCLUSIVE)) { this.eLock = eLock; SysEx.IOTRACE("LOCK {0:x} {1}", this.GetHashCode(), eLock); } } return(rc); }
private RC pagerUnlockDb(VFSLOCK eLock) { var rc = RC.OK; Debug.Assert(!this.exclusiveMode || this.eLock == eLock); Debug.Assert(eLock == VFSLOCK.NO || eLock == VFSLOCK.SHARED); Debug.Assert(eLock != VFSLOCK.NO || !this.pagerUseWal()); if (this.fd.IsOpen) { Debug.Assert(this.eLock >= eLock); rc = this.fd.Unlock(eLock); if (this.eLock != VFSLOCK.UNKNOWN) this.eLock = eLock; SysEx.IOTRACE("UNLOCK {0:x} {1}", this.GetHashCode(), eLock); } return rc; }
private RC pagerUnlockDb(VFSLOCK eLock) { var rc = RC.OK; Debug.Assert(!this.exclusiveMode || this.eLock == eLock); Debug.Assert(eLock == VFSLOCK.NO || eLock == VFSLOCK.SHARED); Debug.Assert(eLock != VFSLOCK.NO || !this.pagerUseWal()); if (this.fd.IsOpen) { Debug.Assert(this.eLock >= eLock); rc = this.fd.Unlock(eLock); if (this.eLock != VFSLOCK.UNKNOWN) { this.eLock = eLock; } SysEx.IOTRACE("UNLOCK {0:x} {1}", this.GetHashCode(), eLock); } return(rc); }
private RC pager_wait_on_lock(VFSLOCK locktype) { // Check that this is either a no-op (because the requested lock is already held, or one of the transistions that the busy-handler // may be invoked during, according to the comment above sqlite3PagerSetBusyhandler(). Debug.Assert((this.eLock >= locktype) || (this.eLock == VFSLOCK.NO && locktype == VFSLOCK.SHARED) || (this.eLock == VFSLOCK.RESERVED && locktype == VFSLOCK.EXCLUSIVE)); RC rc; do rc = pagerLockDb(locktype); while (rc == RC.BUSY && this.xBusyHandler(this.pBusyHandlerArg) != 0); return rc; }