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

Improved comment on cursorOwnsBtShared(). No changes to code.

FossilOrigin-Name: 5e269c2d2667df65592a32d6bc2fa388fd7eb181
This commit is contained in:
drh
2016-06-04 21:05:54 +00:00
parent d66c4f809d
commit 5e08d0fcb6
3 changed files with 16 additions and 7 deletions

View File

@@ -450,6 +450,15 @@ static void releasePage(MemPage *pPage); /* Forward reference */
static int cursorHoldsMutex(BtCursor *p){
return sqlite3_mutex_held(p->pBt->mutex);
}
/* Verify that the cursor and the BtShared agree about what is the current
** database connetion. This is important in shared-cache mode. If the database
** connection pointers get out-of-sync, it is possible for routines like
** btreeInitPage() to reference an stale connection pointer that references a
** a connection that has already closed. This routine is used inside assert()
** statements only and for the purpose of double-checking that the btree code
** does keep the database connection pointers up-to-date.
*/
static int cursorOwnsBtShared(BtCursor *p){
assert( cursorHoldsMutex(p) );
return (p->pBtree->db==p->pBt->db);