Lines Matching refs:locking

1184 ** locking strategy (for example to use dot-file locks), to inquire
1606 ** These integer constants define the various locking operations
2380 ** been invoked for this locking event. ^If the
5965 ** that does no real locking and is appropriate for use in
7019 ** [SQLite Shared-Cache Mode] for a description of shared-cache locking.
9339 ** A SHARED_LOCK is obtained by locking a single randomly-chosen
9343 ** An EXCLUSIVE_LOCK is obtained by locking all bytes in the range.
9344 ** There can only be one writer. A RESERVED_LOCK is obtained by locking
9346 ** A PENDING_LOCK is obtained by locking a designated byte different from
9352 ** for probabilistic locking in Win95/98/ME. Hence, the locking scheme
9357 ** The following #defines specify the range of bytes used for locking.
9362 ** The same locking strategy and
9365 ** and all locking correctly. To do so would require that samba (or whatever
9368 ** using the same locking range we are at least open to the possibility.
9371 ** actual data in the bytes used for locking. The pager never allocates
9372 ** the pages involved in locking therefore. SHARED_SIZE is selected so
9689 u8 dfltLockMode; /* Default locking-mode for attached dbs */
11132 Table **apVtabLock; /* Pointer to virtual tables needing locking */
22897 #define LOCK_TIMEOUT 10L /* the default locking timeout */
23121 ** are inserted in between. The locking might fail on one of the later
23133 ** erases all locks at once and returns us immediately to locking level 0.
23134 ** It is not possible to lower the locking level one step at a time. You
23135 ** must go straight to locking level 0.
23159 /* Make sure the locking sequence is correct
23310 ** Lower the locking level on file descriptor id to locktype. locktype
23313 ** If the locking level of the file descriptor is already at or below
23314 ** the requested locking level, this routine is a no-op.
23513 ** Use main database file for interprocess locking. If un-defined
23596 HFILE hLockFile; /* File used for inter-process memory locking */
23633 ** Constants used for locking
24764 ** The differences are in the way that file locking is done. The default
24766 ** use flock(), dot-files, various proprietary locking schemas, or simply
24767 ** skip locking all together.
24778 ** * Various locking primitive implementations (all except proxy locking):
24782 ** + for flock() locking
24785 ** * sqlite3_file methods not associated with locking.
24786 ** * Definitions of sqlite3_io_methods objects for all locking
24787 ** methods plus "finder" functions for each locking method.
24789 ** * Locking primitives for the proxy uber-locking-method. (MacOSX only)
24790 ** * Definitions of sqlite3_vfs objects for all locking methods
24796 ** There are various methods for file locking used for concurrency
24799 ** 1. POSIX locking (the default),
24800 ** 2. No locking,
24801 ** 3. Dot-file locking,
24802 ** 4. flock() locking,
24803 ** 5. AFP locking (OSX only),
24805 ** 7. proxy locking. (OSX only)
24809 ** selection of the appropriate locking style based on the filesystem
25010 #define UNIXFILE_NOLOCK 0x80 /* Do no file locking */
25296 ** that always succeeds. This means that locking does not occur under
25516 ** Print out information about all locking operations.
25598 ** a locking-related function (i.e. fcntl()) has returned non-zero with
25621 /* EACCES is like EAGAIN during locking operations, but not any other time*/
25853 ** locks on the corresponding inode. There is one locking structure
25855 ** point to the same locking structure. The locking structure keeps
25861 ** Any attempt to lock or unlock a file first checks the locking
26225 ** the first time any lock is attempted. All subsequent system locking
26276 ** are inserted in between. The locking might fail on one of the later
26288 ** routine to lower a locking level.
26326 ** locking a random byte from a range, concurrent SHARED locks may exist
26327 ** even if the locking primitive used is always a write-lock.
26350 /* Make sure the locking sequence is correct.
26525 ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock
26528 ** If the locking level of the file descriptor is already at or below
26529 ** the requested locking level, this routine is a no-op.
26636 ** indicates that the other process is not following the locking
26696 ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock
26699 ** If the locking level of the file descriptor is already at or below
26700 ** the requested locking level, this routine is a no-op.
26708 ** common to all locking schemes. It closes the directory and file
26771 ** Of the various locking implementations available, this is by far the
26772 ** simplest: locking is ignored. No attempt is made to lock the database
26775 ** This locking mode is appropriate for use on read-only databases
26780 ** corruption if this locking mode is used in situations where multiple
26812 ** The dotfile locking implementation uses the existance of separate lock
26822 ** Nevertheless, a dotlock is an appropriate locking mode for use if no
26823 ** other locking strategy is available.
26825 ** Dotfile locking works by creating a subdirectory in the same directory as
26843 ** In dotfile locking, either a lock exists or it does not. So in this
26881 ** are inserted in between. The locking might fail on one of the later
26893 ** routine to lower a locking level.
26895 ** With dotfile locking, we really only support state (4): EXCLUSIVE.
26896 ** But we track the other locking levels internally.
26940 ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock
26943 ** If the locking level of the file descriptor is already at or below
26944 ** the requested locking level, this routine is a no-op.
26946 ** When the locking level reaches NO_LOCK, delete the lock file.
27009 ** Use the flock() system call to do file locking.
27011 ** flock() locking is like dot-file locking in that the various
27012 ** fine-grain locking levels supported by SQLite are collapsed into
27106 ** are inserted in between. The locking might fail on one of the later
27123 ** routine to lower a locking level.
27163 ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock
27166 ** If the locking level of the file descriptor is already at or below
27167 ** the requested locking level, this routine is a no-op.
27218 ** Named semaphore locking is only supported on VxWorks.
27220 ** Semaphore locking is like dot-lock and flock in that it really only
27221 ** supports EXCLUSIVE locking. Only a single process can read or write
27282 ** are inserted in between. The locking might fail on one of the later
27299 ** routine to lower a locking level.
27329 ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock
27332 ** If the locking level of the file descriptor is already at or below
27333 ** the requested locking level, this routine is a no-op.
27387 ** Named semaphore locking is only available on VxWorks.
27533 ** are inserted in between. The locking might fail on one of the later
27545 ** routine to lower a locking level.
27568 /* Make sure the locking sequence is correct
27723 ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock
27726 ** If the locking level of the file descriptor is already at or below
27727 ** the requested locking level, this routine is a no-op.
27830 ** Close a file & cleanup AFP specific locking context
27869 ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock
27872 ** If the locking level of the file descriptor is already at or below
27873 ** the requested locking level, this routine is a no-op.
27889 **************** Non-locking sqlite3_file methods *****************************
27892 ** sqlite3_file object other than the locking methods. The locking
27893 ** methods were defined in divisions above (one locking method per
27894 ** division). Those methods that are common to all locking modes
27973 ** file), the bytes in the locking range should never be read or written. */
28053 ** file), the bytes in the locking range should never be read or written. */
28401 ** Handler for proxy-locking file-control verbs. Defined below in the
28402 ** proxying locking division.
28643 ** Constants used for locking
28657 int ofst, /* First byte of the locking range */
28660 struct flock f; /* The posix advisory locking structure */
28673 /* Initialize the locking parameters */
29225 ** implement various file locking strategies. It also contains definitions
29233 ** looks at the filesystem type and tries to guess the best locking
29251 ** * A constant sqlite3_io_methods object call METHOD that has locking
29286 ** locking strategies. Functions that return pointers to these methods
29354 ** The proxy locking method is a "super-method" in the sense that it
29356 ** it uses proxy, dot-file, AFP, and flock() locking methods on those
29358 ** proxy locking is located much further down in the file. But we need
29360 ** for proxy locking here. So we forward declare the I/O methods.
29393 ** This "finder" function attempts to determine the best locking strategy
29405 const sqlite3_io_methods *pMethods; /* Appropriate locking method */
29459 ** This "finder" function attempts to determine the best locking strategy
29526 ** include the special Apple locking styles.
29535 /* No locking occurs in temporary files */
29564 /* Cache zFilename in the locking context (AFP and dotlock override) for
29605 /* AFP locking uses the file path so it needs to be included in
29632 /* Dotfile locking uses the file path so it needs to be included in
29650 /* Named semaphore locking uses the file path so it needs to be
29764 ** Routine to transform a unixFile into a proxy-locking unixFile.
29934 int noLock; /* True to omit locking primitives */
30029 ** 'conch file' locking functions later on. */
30503 ** Proxy locking is a "uber-locking-method" in this sense: It uses the
30504 ** other locking methods on secondary lock files. Proxy locking is a
30505 ** meta-layer over top of the primitive locking implemented above. For
30506 ** this reason, the division that implements of proxy locking is deferred
30508 ** been defined - so that the primitive locking methods are available
30509 ** as services to help with the implementation of proxy locking.
30513 ** The default locking schemes in SQLite use byte-range locks on the
30515 ** and writers [http://sqlite.org/lockingv3.html]. The five file locking
30539 ** To address the performance and cache coherency issues, proxy file locking
30576 ** How proxy locking works
30579 ** Proxy file locking relies primarily on two new supporting files:
30607 ** This matches the semantics of the traditional locking behavior, where
30621 ** automatically configured for proxy locking, lock files are
30643 ** force proxy locking to be used for every database file opened, and 0
30644 ** will force automatic proxy locking to be disabled for all database
30650 ** Proxy locking is only available on MacOSX
31204 during locking */
31254 proxyLockingContext *pCtx; /* The locking context for the proxy lock */
31316 /* Takes a fully configured proxy locking-style unix file and switches
31365 /* dot lock style uses the locking context to store the dot lock
31370 /* all other styles use the locking context to store the db file path */
31378 ** Takes an already filled in unix file and alters it so all file locking
31380 ** are preserved in the locking context so that they can be restored and
31415 ** (c) the file system is read-only, then enable no-locking access.
31447 ** switch the locking context and pMethod then return.
31470 ** to proxy locking.
31495 /* turn off proxy locking - not supported */
31498 /* turn off proxy locking - already off - NOOP */
31515 /* turn on proxy file locking */
31530 ** Within this division (the proxying locking implementation) the procedures
31532 ** proxy-locking sqlite3_io_method object follow.
31567 ** are inserted in between. The locking might fail on one of the later
31579 ** routine to lower a locking level.
31599 ** Lower the locking level on file descriptor pFile to eFileLock. eFileLock
31602 ** If the locking level of the file descriptor is already at or below
31603 ** the requested locking level, this routine is a no-op.
31652 /* restore the original locking context and pMethod then close it */
31665 ** The proxy locking style is intended for use with AFP filesystems.
31666 ** And since AFP is only supported on MacOSX, the proxy locking is also
31697 ** sqlite_io_methods object that implements the desired locking
31704 ** database file and tries to choose an locking method appropriate for
32036 ** WinCE lacks native support for file locking so we have to fake it
32067 HANDLE hShared; /* Shared memory segment used for locking */
32197 ** These are the special syscall hacks for Windows CE. The locking related
33161 ** will be retried following a locking error - probably caused by
33260 ** Create the mutex and shared memory used for locking in the file
33916 ** are inserted in between. The locking might fail on one of the later
33928 ** erases all locks at once and returns us immediately to locking level 0.
33929 ** It is not possible to lower the locking level one step at a time. You
33930 ** must go straight to locking level 0.
33952 /* Make sure the locking sequence is correct
34081 ** Lower the locking level on file descriptor id to locktype. locktype
34084 ** If the locking level of the file descriptor is already at or below
34085 ** the requested locking level, this routine is a no-op.
34337 ** Constants used for locking
34361 /* Initialize the locking parameters */
38190 ** locking to prevent two processes from writing the same database
38489 ** was) in exclusive-locking mode, a user-level read transaction is
38664 ** following locking-states, according to the lock currently held on
38673 ** when unlocking the file, and only updated when locking the file if the
38700 ** is only changed back to a real locking state after a successful call
39377 ** Pager.eLock variable to the new locking state.
39380 ** called, do not modify it unless the new locking state is EXCLUSIVE_LOCK.
40087 ** normal and exclusive-locking mode.
43033 ** occurs while locking the database, checking for a hot-journal file or
43352 ** number greater than this, or the unused locking-page, is requested. */
43536 ** an EXCLUSIVE lock. If such a lock is already held, no locking
44820 ** Get/set the locking-mode for this pager. Parameter eMode must be one
44823 ** the locking-mode is set to the value specified.
44827 ** locking-mode.
45060 ** exclusive-locking mode when this function is called, take an EXCLUSIVE
45475 ** Indices of various locking bytes. WAL_NREADER is the number
45635 u8 lockError; /* True if a locking error has occurred */
46268 /* Obtain an exclusive lock on all byte in the locking range not already
46468 ** this source file. Verify that the #defines of the locking byte offsets
47031 ** ordinary, rollback-mode locking methods, this guarantees that the
47248 ** and is not honoring the locking protocol. There is a vanishingly small
48218 ** WAL is already in exclusive-locking mode - meaning that this
49012 /* Check for locking consistency */
49305 ** of each BtShared structure and so this locking is not necessary.
50922 ** to problems with locking.
51036 ** even when they are not. This exercises the locking code and
51038 ** statements to find locking problems.
51381 ** of the database file used for locking (beginning at PENDING_BYTE,
57572 ** the Btree objects may have their own mutexes that require locking.
71176 ** locking and error handling infrastructure built into the vdbe.
91996 ** Interpret the given string as a locking mode value.
92434 ** the current default locking mode (which may be different to
92435 ** the locking-mode of the main database).
92442 ** of the PRAGMA command. In this case the locking-mode must be
92447 ** locking mode.
113111 /* SQLITE_PROTOCOL */ "locking protocol",
114496 /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
114497 ** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking