Lines Matching defs:eLock

36790 ** The Pager.eLock variable is almost always set to one of the 
36799 ** pagerUnlockDb() take a conservative approach - eLock is always updated
36801 ** VFS call is successful. This way, the Pager.eLock variable may be set
36826 ** database in the ERROR state, Pager.eLock is set to UNKNOWN_LOCK. It
36829 ** omits the check for a hot-journal if Pager.eLock is set to UNKNOWN_LOCK
36834 ** Pager.eLock may only be set to UNKNOWN_LOCK when the pager is in
36895 ** eLock
37064 u8 eLock; /* Current lock held on database file */
37250 assert( p->tempFile==0 || p->eLock==EXCLUSIVE_LOCK );
37279 assert( pPager->changeCountDone==0 || pPager->eLock>=RESERVED_LOCK );
37280 assert( p->eLock!=PENDING_LOCK );
37291 assert( p->eLock!=UNKNOWN_LOCK );
37292 assert( p->eLock>=SHARED_LOCK || p->noReadlock );
37296 assert( p->eLock!=UNKNOWN_LOCK );
37299 assert( p->eLock>=RESERVED_LOCK );
37308 assert( p->eLock!=UNKNOWN_LOCK );
37316 assert( p->eLock>=RESERVED_LOCK );
37327 assert( p->eLock==EXCLUSIVE_LOCK );
37330 assert( p->eLock>=EXCLUSIVE_LOCK );
37339 assert( p->eLock==EXCLUSIVE_LOCK );
37392 , p->eLock==NO_LOCK ? "NO_LOCK" :
37393 p->eLock==RESERVED_LOCK ? "RESERVED" :
37394 p->eLock==EXCLUSIVE_LOCK ? "EXCLUSIVE" :
37395 p->eLock==SHARED_LOCK ? "SHARED" :
37396 p->eLock==UNKNOWN_LOCK ? "UNKNOWN" : "?error?"
37475 ** Unlock the database file to level eLock, which must be either NO_LOCK
37477 ** succeeds, set the Pager.eLock variable to match the (attempted) new lock.
37479 ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
37483 static int pagerUnlockDb(Pager *pPager, int eLock){
37486 assert( !pPager->exclusiveMode || pPager->eLock==eLock );
37487 assert( eLock==NO_LOCK || eLock==SHARED_LOCK );
37488 assert( eLock!=NO_LOCK || pagerUseWal(pPager)==0 );
37490 assert( pPager->eLock>=eLock );
37491 rc = sqlite3OsUnlock(pPager->fd, eLock);
37492 if( pPager->eLock!=UNKNOWN_LOCK ){
37493 pPager->eLock = (u8)eLock;
37495 IOTRACE(("UNLOCK %p %d\n", pPager, eLock))
37501 ** Lock the database file to level eLock, which must be either SHARED_LOCK,
37503 ** Pager.eLock variable to the new locking state.
37505 ** Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
37510 static int pagerLockDb(Pager *pPager, int eLock){
37513 assert( eLock==SHARED_LOCK || eLock==RESERVED_LOCK || eLock==EXCLUSIVE_LOCK );
37514 if( pPager->eLock<eLock || pPager->eLock==UNKNOWN_LOCK ){
37515 rc = sqlite3OsLock(pPager->fd, eLock);
37516 if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){
37517 pPager->eLock = (u8)eLock;
37518 IOTRACE(("LOCK %p %d\n", pPager, eLock))
38198 pPager->eLock = UNKNOWN_LOCK;
38325 ** eState==PAGER_NONE and eLock==EXCLUSIVE_LOCK.
38330 ** and eLock==EXCLUSIVE_LOCK when the read-transaction is closed.
38334 if( pPager->eState<PAGER_WRITER_LOCKED && pPager->eLock<RESERVED_LOCK ){
38557 || (pPager->eState==PAGER_OPEN && pPager->eLock==EXCLUSIVE_LOCK)
38911 assert( pPager->eLock==EXCLUSIVE_LOCK );
39489 assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock );
39547 assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock );
40071 assert( (pPager->eLock>=locktype)
40072 || (pPager->eLock==NO_LOCK && locktype==SHARED_LOCK)
40073 || (pPager->eLock==RESERVED_LOCK && locktype==EXCLUSIVE_LOCK)
40420 assert( pPager->eLock==EXCLUSIVE_LOCK );
40890 pPager->eLock = EXCLUSIVE_LOCK;
41142 assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK );
41150 if( pPager->eLock<=SHARED_LOCK ){
41231 ** the file. If the unlock attempt fails, then Pager.eLock must be
41249 assert( (pPager->eLock==SHARED_LOCK)
41250 || (pPager->exclusiveMode && pPager->eLock>SHARED_LOCK)
43014 if( pPager->eLock>=RESERVED_LOCK ){
43126 assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK );
43147 assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK || pPager->noReadlock);
46515 u8 eLock; /* READ_LOCK or WRITE_LOCK */
46519 /* Candidate values for BtLock.eLock */
47290 && (pLock->iTable==iTab || (pLock->eLock==WRITE_LOCK && pLock->iTable==1))
47291 && pLock->eLock>=eLockType
47336 ** Query to see if Btree handle p may obtain a lock of type eLock
47341 static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){
47346 assert( eLock==READ_LOCK || eLock==WRITE_LOCK );
47348 assert( !(p->db->flags&SQLITE_ReadUncommitted)||eLock==WRITE_LOCK||iTab==1 );
47354 assert( eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE) );
47355 assert( eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE );
47371 /* The condition (pIter->eLock!=eLock) in the following if(...)
47374 ** (eLock==WRITE_LOCK || pIter->eLock==WRITE_LOCK)
47376 ** since we know that if eLock==WRITE_LOCK, then no other connection
47380 assert( pIter->eLock==READ_LOCK || pIter->eLock==WRITE_LOCK );
47381 assert( eLock==READ_LOCK || pIter->pBtree==p || pIter->eLock==READ_LOCK);
47382 if( pIter->pBtree!=p && pIter->iTable==iTab && pIter->eLock!=eLock ){
47384 if( eLock==WRITE_LOCK ){
47398 ** by Btree handle p. Parameter eLock must be either READ_LOCK or
47413 static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){
47419 assert( eLock==READ_LOCK || eLock==WRITE_LOCK );
47426 assert( 0==(p->db->flags&SQLITE_ReadUncommitted) || eLock==WRITE_LOCK );
47431 assert( SQLITE_OK==querySharedCacheTableLock(p, iTable, eLock) );
47455 /* Set the BtLock.eLock variable to the maximum of the current lock
47460 if( eLock>pLock->eLock ){
47461 pLock->eLock = eLock;
47488 assert( pLock->pBtree->inTrans>=pLock->eLock );
47530 assert( pLock->eLock==READ_LOCK || pLock->pBtree==p );
47531 pLock->eLock = READ_LOCK;
49730 p->lock.eLock = READ_LOCK;