1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-21 13:38:01 +03:00

Fix a comment related to PENDING locks in os_unix.c. No code changes.

FossilOrigin-Name: 6b3546c871fe78a4e550e0144b48ac98325787cc8b192a9e7f5f2a2ffa57f76d
This commit is contained in:
dan
2023-02-01 14:17:25 +00:00
parent 4209742161
commit 288409d731
3 changed files with 22 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
C Fix\sa\srace\scondition\sduring\shot-journal\srollback\son\sunix\sthat\scould\stheoretically\scause\sspurious\scorruption\serrors.
D 2023-01-31T20:43:21.518
C Fix\sa\scomment\srelated\sto\sPENDING\slocks\sin\sos_unix.c.\sNo\scode\schanges.
D 2023-02-01T14:17:25.856
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -604,7 +604,7 @@ F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06
F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a
F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107
F src/os_unix.c 85096ad0bb4e6a6ac3764603cea0f5332816fa25f0e50c936453edc8ac9acee7
F src/os_unix.c 49b0d3d0f86fc4736d1b9a71035bbd791b892ed6908803f270d4d71f149c60ac
F src/os_win.c 295fe45f18bd86f2477f4cd79f3377c6f883ceb941b1f46808665c73747f2345
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
F src/pager.c fc6d3ec7017d7369ab5dc5421ad1763ff224551c9381866b6da69040db62e406
@@ -2046,9 +2046,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P bf1aae7a8c7f2c74681aa29baa35259d10ce6a1737d2607def6bf27fed592131 20ea53ddf590a9dd19501fabd2bfdb9c10b5eb265cd2995bdb335769c936c763
R acc2b6cc65d6bb367d9e15964ca7789d
T +closed 20ea53ddf590a9dd19501fabd2bfdb9c10b5eb265cd2995bdb335769c936c763
P e365dca4e5775b4897118c8937a1063282d7a1ecc2604529256b0a6b8a3510ba
R fb035ed50ecd9dcfe4baa0545c9c7232
U dan
Z ba4534b9ca16705b4343f518cb36fba2
Z 000725ab58aa79e849a1ff78f61507a0
# Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
e365dca4e5775b4897118c8937a1063282d7a1ecc2604529256b0a6b8a3510ba
6b3546c871fe78a4e550e0144b48ac98325787cc8b192a9e7f5f2a2ffa57f76d

View File

@@ -1651,8 +1651,8 @@ static int unixFileLock(unixFile *pFile, struct flock *pLock){
**
** UNLOCKED -> SHARED
** SHARED -> RESERVED
** SHARED -> (PENDING) -> EXCLUSIVE
** RESERVED -> EXCLUSIVE
** SHARED -> EXCLUSIVE
** RESERVED -> (PENDING) -> EXCLUSIVE
** PENDING -> EXCLUSIVE
**
** This routine will only increase a lock. Use the sqlite3OsUnlock()
@@ -1684,19 +1684,20 @@ static int unixLock(sqlite3_file *id, int eFileLock){
** A RESERVED lock is implemented by grabbing a write-lock on the
** 'reserved byte'.
**
** A process may only obtain a PENDING lock after it has obtained a
** SHARED lock. A PENDING lock is implemented by obtaining a write-lock
** on the 'pending byte'. This ensures that no new SHARED locks can be
** obtained, but existing SHARED locks are allowed to persist. A process
** does not have to obtain a RESERVED lock on the way to a PENDING lock.
** This property is used by the algorithm for rolling back a journal file
** after a crash.
** An EXCLUSIVE lock may only be requested after either a SHARED or
** RESERVED lock is held. An EXCLUSIVE lock is implemented by obtaining
** a write-lock on the entire 'shared byte range'. Since all other locks
** require a read-lock on one of the bytes within this range, this ensures
** that no other locks are held on the database.
**
** An EXCLUSIVE lock, obtained after a PENDING lock is held, is
** implemented by obtaining a write-lock on the entire 'shared byte
** range'. Since all other locks require a read-lock on one of the bytes
** within this range, this ensures that no other locks are held on the
** database.
** If a process that holds a RESERVED lock requests an EXCLUSIVE, then
** a PENDING lock is obtained first. A PENDING lock is implemented by
** obtaining a write-lock on the 'pending byte'. This ensures that no new
** SHARED locks can be obtained, but existing SHARED locks are allowed to
** persist. If the call to this function fails to obtain the EXCLUSIVE
** lock in this case, it holds the PENDING lock intead. The client may
** then re-attempt the EXCLUSIVE lock later on, after existing SHARED
** locks have cleared.
*/
int rc = SQLITE_OK;
unixFile *pFile = (unixFile*)id;