1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Hold the database handle mutex for the duration of sqlite3_db_release_memory().

FossilOrigin-Name: eeaf2988004ff5343be60ab4ba2f809f76c94b51
This commit is contained in:
dan
2011-12-30 11:43:59 +00:00
parent 0420b74a94
commit d9bb3a9749
4 changed files with 11 additions and 9 deletions

View File

@@ -540,6 +540,7 @@ sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){
*/
int sqlite3_db_release_memory(sqlite3 *db){
int i;
sqlite3_mutex_enter(db->mutex);
sqlite3BtreeEnterAll(db);
for(i=0; i<db->nDb; i++){
Btree *pBt = db->aDb[i].pBt;
@@ -549,6 +550,7 @@ int sqlite3_db_release_memory(sqlite3 *db){
}
}
sqlite3BtreeLeaveAll(db);
sqlite3_mutex_leave(db->mutex);
return SQLITE_OK;
}