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

In shared-cache mode, make sure the busy hander invoked is the

busy handler associated with the database connection that caused
the lock contention in the first place. (CVS 4598)

FossilOrigin-Name: c9eb65912f61ce0a6b66fe253652a1827e46b12a
This commit is contained in:
drh
2007-12-07 18:55:28 +00:00
parent b9175aed38
commit e5fe690d75
10 changed files with 110 additions and 85 deletions

View File

@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
** $Id: test3.c,v 1.87 2007/09/12 17:01:45 danielk1977 Exp $
** $Id: test3.c,v 1.88 2007/12/07 18:55:29 drh Exp $
*/
#include "sqliteInt.h"
#include "btreeInt.h"
@@ -566,7 +566,7 @@ static int btree_pager_stats(
** we need to obtain the mutex for the controlling SQLite handle before
** it is safe to call sqlite3BtreeEnter().
*/
sqlite3_mutex_enter(pBt->pSqlite->mutex);
sqlite3_mutex_enter(pBt->db->mutex);
sqlite3BtreeEnter(pBt);
a = sqlite3PagerStats(sqlite3BtreePager(pBt));
@@ -583,7 +583,7 @@ static int btree_pager_stats(
sqlite3BtreeLeave(pBt);
/* Release the mutex on the SQLite handle that controls this b-tree */
sqlite3_mutex_leave(pBt->pSqlite->mutex);
sqlite3_mutex_leave(pBt->db->mutex);
return TCL_OK;
}
@@ -1591,11 +1591,11 @@ static int btree_set_cache_size(
pBt = sqlite3TextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
sqlite3_mutex_enter(pBt->pSqlite->mutex);
sqlite3_mutex_enter(pBt->db->mutex);
sqlite3BtreeEnter(pBt);
sqlite3BtreeSetCacheSize(pBt, nCache);
sqlite3BtreeLeave(pBt);
sqlite3_mutex_leave(pBt->pSqlite->mutex);
sqlite3_mutex_leave(pBt->db->mutex);
return TCL_OK;
}