Lines Matching full:locks
1096 ** functions to enable blocking locks with timeouts, to change the
1097 ** locking strategy (for example to use dot-file locks), to inquire
1098 ** about the status of a lock, or to break stale locks. The SQLite
3344 ** database locks it needs to do its job. ^If the statement is a [COMMIT]
6046 ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or
6056 ** ^Shared-cache locks are released when a database connection concludes
7959 ** sqlite3OsLock(). The various locks exhibit the following semantics:
7963 ** any time. Other processes may hold and obtain new SHARED locks.
7965 ** any one time. Existing SHARED locks may persist, but no new
7966 ** SHARED locks may be obtained by other processes.
7967 ** EXCLUSIVE: An EXCLUSIVE lock precludes all other locks.
7999 ** which means we can use reader/writer locks. When reader/writer locks
8009 ** shared locks begins at SHARED_FIRST.
8015 ** tool is being used for file sharing) implements locks correctly between
8022 ** that all locks will fit on a single page even at the minimum page size.
8023 ** PENDING_BYTE defines the beginning of the locks. By default PENDING_BYTE
8401 ** tried to do recently failed with an SQLITE_LOCKED error due to locks
9621 ** used to store the set of table-locks required by the statement being
9664 int nTableLock; /* Number of locks in aTableLock */
9665 TableLock *aTableLock; /* Required table locks for shared-cache mode */
10794 ** for use by the VFS layers as space for managing file locks.
10870 ** caller holds appropriate locks.
17829 BtreeMutexArray aMutex; /* An array of Btree used here and needing locks */
20444 ** erases all locks at once and returns us immediately to locking level 0.
21306 ** implementation uses Posix Advisory Locks. Alternative implementations
21320 ** + for Posix Advisory Locks
21321 ** + for no-op locks
21322 ** + for dot-file locks
21324 ** + for named semaphore locks (VxWorks only)
21325 ** + for AFP filesystem locks (MacOSX only)
21476 struct unixLockInfo *pLock; /* Info about locks on this inode */
21830 ** This routine is used for troubleshooting locks on multithreaded
21894 ** Errors during initialization of locks, or file system support for locks,
22095 ** POSIX advisory locks are broken by design. ANSI STD 1003.1 (1996)
22097 ** sets or clears a lock, that operation overrides any prior locks set
22099 ** that it overrides locks set by the same process using a different
22110 ** But not so. Since both locks came from the same process, the
22114 ** This means that we cannot use POSIX locks to synchronize file access
22115 ** among competing threads of the same process. POSIX locks will work fine
22119 ** To work around the problem, SQLite has to manage file locks internally
22123 ** and check for locks already existing on that inode. When locks are
22125 ** locks to see if another thread has previously set a lock on that same
22135 ** locks on the corresponding inode. There is one locking structure
22141 ** cnt>0 means there are cnt shared locks on the file.
22148 ** But wait: there are yet more problems with POSIX advisory locks.
22150 ** If you close a file descriptor that points to a file that has locks,
22151 ** all locks on that file that are owned by the current process are
22156 ** other unixFile open on the same inode that are holding locks, the call
22157 ** to close() the file descriptor is deferred until all of the locks clear.
22162 ** Yet another problem: LinuxThreads do not play well with posix locks.
22169 ** on linux - with NPTL a lock created by thread A can override locks
22172 ** compile-time whether or not thread A can override locks on thread B.
22176 ** On systems where thread A is unable to modify locks created by
22189 ** not allow locks to be overridden by other threads and that restriction
22191 ** to another while locks are held.
22195 ** overriding each others locks (which is now the most common behavior)
22196 ** or if no locks are held. But the unixFile.pLock field needs to be
22227 ** If threads cannot override each others locks (LinuxThreads), then we
22229 ** each others locks (Posix and NPTL) then tid is always set to zero.
22251 int cnt; /* Number of SHARED locks held */
22260 ** inode. This structure keeps track of the number of locks on that
22262 ** locks, the close is deferred until all locks clear by adding the
22273 int nLock; /* Number of outstanding locks */
22293 ** locks.
22295 ** 0: No. Threads cannot override each others locks. (LinuxThreads)
22296 ** 1: Yes. Threads can override each others locks. (Posix & NLPT)
22300 ** others locks. On those systems, the SQLITE_THREAD_OVERRIDE_LOCK macro
22351 ** can override each others locks then sets the
22753 /* The following describes the implementation of the various locks and
22755 ** lock primitives (called read-locks and write-locks below, to avoid
22774 ** on the 'pending byte'. This ensures that no new SHARED locks can be
22775 ** obtained, but existing SHARED locks are allowed to persist. A process
22782 ** range'. Since all other locks require a read-lock on one of the bytes
22783 ** within this range, this ensures that no other locks are held on the
22787 ** range' is that some versions of windows do not support read-locks. By
22788 ** locking a random byte from a range, concurrent SHARED locks may exist
23130 /* Decrement the count of locks against this same file. When the
23132 ** was deferred because of outstanding locks.
23207 /* If there are outstanding locks, do not actually close the file just
23208 ** yet because that would clear those locks. Instead, add the file
23471 ** PENDING locks are the same thing as an EXCLUSIVE lock. SQLite
23560 ** flock() only really support EXCLUSIVE locks. We track intermediate
23561 ** lock states in the sqlite3_file structure, but all locks SHARED or
23562 ** above are really EXCLUSIVE locks and exclude all other processes from
23745 ** Semaphore locks only really support EXCLUSIVE locks. We track intermediate
23746 ** lock states in the sqlite3_file structure, but all locks SHARED or
23747 ** above are really EXCLUSIVE locks and exclude all other processes from
24203 /* If there are outstanding locks, do not actually close the file just
24204 ** yet because that would clear those locks. Instead, add the file
24859 ** flag to force the posix advisory locks to cover the whole file instead
24947 ** assume that the file-system supports POSIX style locks.
24985 /* Test if fcntl() is supported and use POSIX style locks.
25081 ** handle h - as it is guaranteed that no posix locks will be released
25494 ** it would not be safe to close as this would release any locks held
25522 ** on that file that are currently holding advisory locks on it,
25523 ** then the call to close() will cancel those locks. In practice,
25876 ** The default locking schemes in SQLite use byte-range locks on the
25880 ** as POSIX read & write locks over fixed set of locations (via fsctl),
25881 ** on AFP and SMB only exclusive byte-range locks are available via fsctl
25893 ** the read cache when byte-range locks are present. Enabling the read
25904 ** single host at a time and moving file locks off of the database file
25908 ** Using proxy locks
25947 ** * proxy file to act as a proxy for the advisory locks normally
25963 ** The proxy file - a single-byte file used for all advisory file locks
26241 ** POSIX locks prematurely.
26935 ** Close a file that uses proxy locks.
27397 int nReaders; /* Number of reader locks obtained */
27420 winceLock local; /* Locks obtained by this instance of winFile */
27735 ** Destroy the part of winFile that deals with wince locks
27743 are to cleanup in case any locks remained open */
28225 ** erases all locks at once and returns us immediately to locking level 0.
32688 ** it moves to PAGER_EXCLUSIVE. No locks are downgraded when running in
35214 ** Since Lookup() never goes to disk, it never has to deal with locks
35528 /* If the required locks were successfully obtained, open the journal
35604 ** which means they have acquired the necessary locks and opened
35628 ** contains the database locks. The following assert verifies
36170 ** to drop any locks either.
37100 ** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor
37101 ** is opened on the table with root page BtShared.iTable. Locks are removed
37183 ** table (because there exists one or more read-locks on the table),
37191 ** 2) The number of locks held by other connections drops to zero.
37224 BtLock *pLock; /* List of locks held on this shared-btree struct */
37227 u8 isPending; /* If waiting for read-locks to clear */
37523 /* To avoid deadlock, first release all locks with a larger
37525 ** the other BtShared locks that we used to hold in ascending
37852 ** shared-cache table level locks. If the library is compiled with the
37871 ** Check to see if pBtree holds the required locks to read or write to the
37912 ** the correct locks are held. So do not bother - just return true.
38120 ** Release all the table locks (locks obtained via calls to
38158 ** that writer, then the number of locks held by connections other
38170 ** This function changes all write-locks held by Btree p into read-locks.
39766 ** The call to sqlite3BtreeRollback() drops any table-locks held by
40730 ** disk and we are still holding all locks, so the transaction has not
40814 ** drop locks.
41017 ** from a normal transaction rollback, as no locks are released and the
41081 ** b-tree database, the connection is holding the required table locks,
45649 ** (d) there are no conflicting read-locks, and
49572 /* Release the locks */
49590 /* If the auto-commit flag is set to true, then any locks that were held
66646 ** obtain the required table-locks. This is a no-op unless the
77692 ** the value sets a specific file to be used for database access locks.
78929 ** locks on the schema, we just need to make sure nobody else is
85781 ** database. No locks are held on any other files (since the main file
85889 ** Locks nest. Every lock should have a corresponding unlock.
85893 ** the disconnect is deferred until all locks have been removed.
96097 ** locks and does not require any further unlock-notify callbacks.
97934 ** its locks.
98000 ** the transaction opened by database db has just finished. Locks held