1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Add new tests to the threadtest4.c program. Fix a long-standing data race

in WAL mode for shared-cache.

FossilOrigin-Name: d8d3e6d04cbb9e3033ad8613e3dbd4ad0b01765a
This commit is contained in:
drh
2014-12-12 01:27:17 +00:00
parent 2ea0bafae2
commit ef15c6e9e6
4 changed files with 35 additions and 14 deletions

View File

@@ -400,7 +400,10 @@ static int doWalCallbacks(sqlite3 *db){
for(i=0; i<db->nDb; i++){
Btree *pBt = db->aDb[i].pBt;
if( pBt ){
int nEntry = sqlite3PagerWalCallback(sqlite3BtreePager(pBt));
int nEntry;
sqlite3BtreeEnter(pBt);
nEntry = sqlite3PagerWalCallback(sqlite3BtreePager(pBt));
sqlite3BtreeLeave(pBt);
if( db->xWalCallback && nEntry>0 && rc==SQLITE_OK ){
rc = db->xWalCallback(db->pWalArg, db, db->aDb[i].zName, nEntry);
}