1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Have sqlite3_enable_setlk(-1) configure indefinite blocking locks where they are supported.

FossilOrigin-Name: 62009565d2f2a2c4d347e1da0d5b4ad43056742df47fd6ddb92e62f53a2b57f1
This commit is contained in:
dan
2025-01-30 15:26:16 +00:00
parent 43aad25b1b
commit 462888819e
8 changed files with 127 additions and 27 deletions

View File

@@ -1827,12 +1827,16 @@ int sqlite3_busy_timeout(sqlite3 *db, int ms){
return SQLITE_OK;
}
/*
** Set the setlk timeout value.
*/
int sqlite3_setlk_timeout(sqlite3 *db, int ms){
#ifdef SQLITE_ENABLE_API_ARMOR
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#endif
if( ms<-1 ) return SQLITE_RANGE;
#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
db->setlkTimeout = (ms>0 ? ms : 0);
db->setlkTimeout = ms;
#endif
return SQLITE_OK;
}