diff options
author | dan <Dan Kennedy> | 2025-06-12 07:35:38 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2025-06-12 07:35:38 +0000 |
commit | 792d1d1b6d61453c4c4af6813f5877818f51a13c (patch) | |
tree | 6324de3499e440ba4084c7066895eb2f45e6375b /src/main.c | |
parent | 6a5e74cbf04e79dd7971e6dff723ef1499eddfe4 (diff) | |
download | sqlite-792d1d1b6d61453c4c4af6813f5877818f51a13c.tar.gz sqlite-792d1d1b6d61453c4c4af6813f5877818f51a13c.zip |
Have sqlite3_setlk_timeout() take the database handle mutex. This fixes an assert() failure that could occur if sqlite3_setlk_timeout() were called on a threadsafe handle.
FossilOrigin-Name: a95d126e1330e1b83f42b51f97c4c216622cf38062f3b5d72ccb76313187e850
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 9b67de815..0dd9926fe 100644 --- a/src/main.c +++ b/src/main.c @@ -1861,6 +1861,7 @@ int sqlite3_setlk_timeout(sqlite3 *db, int ms, int flags){ #endif if( ms<-1 ) return SQLITE_RANGE; #ifdef SQLITE_ENABLE_SETLK_TIMEOUT + sqlite3_mutex_enter(db->mutex); db->setlkTimeout = ms; db->setlkFlags = flags; sqlite3BtreeEnterAll(db); @@ -1872,6 +1873,7 @@ int sqlite3_setlk_timeout(sqlite3 *db, int ms, int flags){ } } sqlite3BtreeLeaveAll(db); + sqlite3_mutex_leave(db->mutex); #endif #if !defined(SQLITE_ENABLE_API_ARMOR) && !defined(SQLITE_ENABLE_SETLK_TIMEOUT) UNUSED_PARAMETER(db); |