Home
last modified time | relevance | path

Searched refs:lock (Results 1 – 25 of 82) sorted by relevance

1234

/sqlite-3.40.0/test/
H A Dlock.test22 do_test lock-1.0 {
29 do_test lock-1.1 {
32 do_test lock-1.2 {
35 do_test lock-1.3 {
39 do_test lock-1.5 {
45 do_test lock-1.6 {
56 do_test lock-1.8 {
60 do_test lock-1.9 {
63 do_test lock-1.10 {
68 do_test lock-1.11 {
[all …]
H A Dshmlock.test32 1 db {shared lock 7 1} OK
33 2 db2 {exclusive lock 7 1} BUSY
35 4 db2 {exclusive lock 7 1} OK
40 8 db {exclusive lock 0 8} OK
42 10 db2 {exclusive lock 0 8} OK
45 12 db {shared lock 0 1} OK
46 13 db2 {shared lock 0 1} OK
47 14 db3 {shared lock 0 1} OK
53 20 db3 {exclusive lock 0 1} OK
56 22 db {shared lock 3 1} OK
[all …]
H A Dwalprotocol.test37 # the WRITER lock (should be the same). Test case 1.4.
45 proc lock_callback {method filename handle lock} {
46 lappend ::locks $lock
56 } [list {0 1 lock exclusive} {1 2 lock exclusive} \
70 } [list {0 1 lock exclusive} {1 2 lock exclusive} \
78 proc lock_callback {method filename handle lock} {
79 if {$lock == "1 2 lock exclusive"} { return SQLITE_BUSY }
93 proc lock_callback {method filename handle lock} {
94 if {$lock == "0 1 lock exclusive"} { return SQLITE_BUSY }
105 proc lock_callback {method filename handle lock} {
[all …]
H A Dwalprotocol2.test24 # to lock all other bytes (because some other process is holding a read
29 # the WRITER lock (should be the same). Test case 1.4.
39 proc lock_callback {method filename handle lock} {
40 # puts "$method $filename $handle $lock"
59 # Rig the xShmLock() callback so that just before the EXCLUSIVE lock
64 proc lock_callback {method filename handle lock} {
65 if {$lock=="0 1 lock exclusive"} {
66 proc lock_callback {method filename handle lock} {}
82 proc lock_callback {method filename handle lock} {
83 if {$lock=="0 1 lock exclusive"} {
[all …]
H A Dshared6.test38 # 1.2.1: If [db1] has an exclusive lock, [db2] cannot read.
39 # 1.2.2: If [db1] has an exclusive lock, [db1] can read.
40 # 1.2.3: If [db1] has a non-exclusive write-lock, [db2] can read.
64 # 1.3.1: If [db1] has a write-lock on t1, [db1] can read from t1.
65 # 1.3.2: If [db1] has a write-lock on t1, [db2] can read from t2.
67 # 1.3.4: If [db1] has a write-lock on t1, [db2] cannot write to t1.
68 # 1.3.5: If [db1] has a read-lock on t1, [db2] can read from t1.
69 # 1.3.6: If [db1] has a read-lock on t1, [db2] cannot write to t1.
109 # 1.4.3: If [db1] has a read-lock on t1, [db2] cannot write to t1.
182 # already holding a read-lock on the database file. And that it is
[all …]
H A Dwal2.test125 {0 1 lock exclusive} {1 2 lock exclusive} \
190 set WRITER [list 0 1 lock exclusive]
246 set lock [lindex $args 2]
247 lappend ::locks $lock
248 if {$lock == $::WRITER} {
267 set lock [lindex $args 2]
268 lappend ::locks $lock
640 {0 1 lock exclusive} {1 2 lock exclusive}
651 {3 1 lock shared}
653 {4 1 lock exclusive} {4 1 unlock exclusive} {4 1 lock shared}
[all …]
H A Dwal3.test248 # running recovery, it fails to obtain a lock on an aReadMark[] slot
250 # a shared lock on the RECOVER lock to see if there really is a
299 if { $spec == "2 1 lock shared" } {
355 # obtain a different read-lock.
382 # as it is obtaining the lock, [db2] appends to the log file.
387 if {$spec == "3 1 lock shared"} {
404 # [db] should be left holding a read-lock on some slot other than
496 # wal-index header and the lock was obtained that a writer has
498 # wal-index header and lock a snapshot corresponding to the new
540 } {{4 1 lock shared} {4 1 unlock shared} {5 1 lock shared} {5 1 unlock shared}}
[all …]
H A Dthreadtest1.c190 pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; variable
202 pthread_mutex_lock(&lock); in worker_bee()
204 pthread_mutex_unlock(&lock); in worker_bee()
239 pthread_mutex_lock(&lock); in worker_bee()
244 pthread_mutex_unlock(&lock); in worker_bee()
278 pthread_mutex_lock(&lock); in main()
280 pthread_cond_wait(&sig, &lock); in main()
282 pthread_mutex_unlock(&lock); in main()
H A Dlock2.test25 # lock2-1.2: Establish a RESERVED lock with this process.
26 # lock2-1.3: Get a SHARED lock with the second process.
27 # lock2-1.4: Try for a RESERVED lock with process 2. This fails.
30 # lock2-1.6: Release the SHARED lock held by the second process.
31 # lock2-1.7: Attempt to reaquire a SHARED lock with the second process.
32 # this fails due to the PENDING lock.
H A Dlock5.test27 forcedelete test.db.lock
48 file exists test.db.lock
53 file exists test.db.lock
72 file exists test.db.lock
91 file exists test.db.lock
98 file exists test.db.lock
120 file exists test.db.lock
H A Dattach2.test59 # lock test2.db then try to attach it. This is no longer an error because
60 # db2 just RESERVES the database. It does not obtain a write-lock until
83 # lock test2.db and try to read from it. This should still work because
84 # the lock is only a RESERVED lock which does not prevent reading.
202 # The read lock held by db does not prevent db2 from reading test.db
210 # db is holding a read lock on test.db, so we should not be able
223 # a reserved lock to promote to exclusive. That will mess up our
265 # Ensure handle 'db' retains the lock on the main file after
266 # failing to obtain a write-lock on file2.
284 # Try to upgrade the handle 'db' lock.
[all …]
H A Dtkt3093.test14 # Verify that a busy callback waiting on a reserved lock resolves
15 # once the lock clears.
43 # Make sure that clearing a lock allows a pending request for
44 # a reserved lock to continue.
49 # the lock so that there should not be a second callback. If the
H A Dthread1.test44 # read-lock A
45 # read-lock B
48 # write-lock C
50 # At one point, the write-lock of C would fail on Linux.
103 # 1: Read-lock thread A
104 # 2: Read-lock thread B
H A Djrnlmode2.test35 # * there exists a connection with a shared lock on the db file,
39 # not a hot-journal, SQLite currently grabs an exclusive lock on the
41 # lock, then SQLITE_BUSY is returned to the user.
50 # attempts to obtain an exclusive lock on the database file (this is a
51 # bug). The attempt to obtain an exclusive (write) lock on a read-only file
H A Dsharedlock.test42 # This should fail. Connection [db] has a read-lock on t1, which should
43 # prevent connection [db2] from obtaining the write-lock it needs to
45 # to drop the read-lock belonging to [db].
53 # Test that a write-lock is taken on a table when its entire contents
H A Dtkt3793.test56 # Establish a read-lock on the database file using connection [db].
67 # hold a RESERVED lock on the database file. Even though there are now
69 # lock because of the read-lock held by [db].
84 # SQLite will attempt to upgrade to an EXCLUSIVE lock, and hence invoke
H A Dtkt2854.test38 # Check that an exclusive lock cannot be obtained if some other
39 # shared-cache connection has a read-lock on a table.
60 # Check that an exclusive lock prevents other shared-cache users from
83 # Check that an exclusive lock prevents other shared-cache users from
117 # Check that if an attempt to obtain an exclusive lock fails because an
H A Dpragma2.test182 } {main exclusive temp unknown} ;# EXCLUSIVE lock due to cache spill
192 } {0 main reserved temp unknown} ;# No cache spill, so no exclusive lock
207 } {100000 main reserved temp unknown} ;# Big spill threshold -> no excl lock
218 } {50 main exclusive temp unknown} ;# Small cache spill -> exclusive lock
228 } {50 main exclusive temp unknown} ;# Small cache spill -> exclusive lock
H A Dserver1.test62 # read-lock A
63 # read-lock B
66 # write-lock C
117 # will leave the lock pending.
/sqlite-3.40.0/doc/
H A Dwal-lock.md10 need to continuously poll the database lock, and (b) using blocking locks
27 Before recovery commences, an exclusive WRITER lock is taken.
32 client blocks on the WRITER lock.
42 blocking lock is used to obtain the CHECKPOINTER lock in this case. A snapshot
48 A database writer must obtain the exclusive WRITER lock. It uses a blocking
49 lock to do so if any of the following are true:
58 to a write-transaction. In that case a non-blocking lock is used.
64 * The exclusive CHECKPOINTER lock.
65 * The exclusive WRITER lock (FULL, RESTART and TRUNCATE only).
67 * Exclusive lock on read-mark 0.
[all …]
H A Dvfs-shm.txt1 The 5 states of an historical rollback lock as implemented by the
24 These roughly correspond to the 5 states of a rollback lock except
35 the READ lock.
46 CHECKPOINT lock can be acquired.
59 A particular lock manager implementation may coalesce one or more of
69 The lock manager must obey the following rules:
77 during testing using an instrumented lock manager.
80 kind of SHM lock or an EXCLUSIVE lock on the original database.
103 request a READ_FULL or PENDING lock though the lock manager may deliver
108 The following are the allowed lock transitions:
[all …]
H A DF2FS.txt33 /* Take an F_WRLCK lock on the database file. This prevents any other
34 ** SQLite clients from reading or writing the file until the lock
58 ** relinquishes the F_WRLCK lock. */
81 before the posix advisory lock is automatically dropped - there is
/sqlite-3.40.0/ext/lsm1/
H A Dlsm_unix.c320 struct flock lock; in lsmPosixOsLock() local
328 memset(&lock, 0, sizeof(lock)); in lsmPosixOsLock()
329 lock.l_whence = SEEK_SET; in lsmPosixOsLock()
330 lock.l_len = 1; in lsmPosixOsLock()
331 lock.l_type = aType[eType]; in lsmPosixOsLock()
332 lock.l_start = (4096-iLock); in lsmPosixOsLock()
350 struct flock lock; in lsmPosixOsTestLock() local
358 memset(&lock, 0, sizeof(lock)); in lsmPosixOsTestLock()
359 lock.l_whence = SEEK_SET; in lsmPosixOsTestLock()
360 lock.l_len = nLock; in lsmPosixOsTestLock()
[all …]
/sqlite-3.40.0/src/
H A Dos_unix.c1527 struct flock lock; in unixCheckReservedLock() local
1530 lock.l_len = 1; in unixCheckReservedLock()
1701 struct flock lock; in unixLock() local
1764 lock.l_len = 1L; in unixLock()
1800 lock.l_len = 1L; in unixLock()
1833 lock.l_len = 1L; in unixLock()
1911 struct flock lock; in posixUnlock() local
2033 lock.l_start = lock.l_len = 0L; in posixUnlock()
4501 struct flock lock; in unixLockSharedMemory() local
4524 lock.l_len = 1; in unixLockSharedMemory()
[all …]
/sqlite-3.40.0/ext/async/
H A Dsqlite3async.c632 p->lock.eLock = 0; in asyncClose()
868 if( p->lock.eLock<eLock ){ in asyncLock()
873 if( pIter!=&p->lock && ( in asyncLock()
883 p->lock.eLock = eLock; in asyncLock()
884 p->lock.eAsyncLock = MAX(p->lock.eAsyncLock, eLock); in asyncLock()
886 assert(p->lock.eAsyncLock>=p->lock.eLock); in asyncLock()
901 AsyncFileLock *pLock = &p->lock; in asyncUnlock()
971 if( (*ppIter)==&pData->lock ){ in unlinkAsyncFile()
1133 pLock->pList = &pData->lock; in asyncOpen()
1501 pData->lock.eAsyncLock, MAX(pData->lock.eLock, eLock) in asyncWriterThread()
[all …]

1234