aboutsummaryrefslogtreecommitdiff
path: root/src/os.c
diff options
context:
space:
mode:
authordrh <>2022-10-04 14:50:46 +0000
committerdrh <>2022-10-04 14:50:46 +0000
commit2eca06141feae3d241776e59b798b4aa1ce128b6 (patch)
treec470c67c66b29ddc8af5afc10aa183a39ea2d9ff /src/os.c
parenta4b2f419382c95cd2f4924d0394f37b3d2f0cfce (diff)
downloadsqlite-2eca06141feae3d241776e59b798b4aa1ce128b6.tar.gz
sqlite-2eca06141feae3d241776e59b798b4aa1ce128b6.zip
Attempt to clarify the operation of the xLock and xUnlock VFS I/O methods.
Assert() statements added to prove that they behave as the documentation says. FossilOrigin-Name: 3efa811251d4510a074231a1e0b667783cc5f90777466b9dcae675cd9892b423
Diffstat (limited to 'src/os.c')
-rw-r--r--src/os.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os.c b/src/os.c
index 13c9abcab..e2914e03c 100644
--- a/src/os.c
+++ b/src/os.c
@@ -106,9 +106,11 @@ int sqlite3OsFileSize(sqlite3_file *id, i64 *pSize){
}
int sqlite3OsLock(sqlite3_file *id, int lockType){
DO_OS_MALLOC_TEST(id);
+ assert( lockType>=SQLITE_LOCK_SHARED && lockType<=SQLITE_LOCK_EXCLUSIVE );
return id->pMethods->xLock(id, lockType);
}
int sqlite3OsUnlock(sqlite3_file *id, int lockType){
+ assert( lockType==SQLITE_LOCK_NONE || lockType==SQLITE_LOCK_SHARED );
return id->pMethods->xUnlock(id, lockType);
}
int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut){