1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-24 08:21:29 +03:00

Remove the BtreeMutexArray object - use the Vdbe.btreeMask field to accomplish

the same result.  Add a generation counter to btree mutexes in order to assert
that mutexes are never temporarily dropped over a range of instructions in order
to do deadlock avoidance in some subroutine.  Lock all btrees in any Vdbe
program that uses OP_ParseSchema.

FossilOrigin-Name: d81708f7d1eee399bfe76f6b8dac950a85dc2582
This commit is contained in:
drh
2011-04-04 00:14:43 +00:00
parent dddd779b2b
commit bdaec52c62
8 changed files with 242 additions and 198 deletions

View File

@@ -426,7 +426,7 @@ struct BtShared {
u32 nPage; /* Number of pages in the database */
void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
void (*xFreeSchema)(void*); /* Destructor for BtShared.pSchema */
sqlite3_mutex *mutex; /* Non-recursive mutex required to access this struct */
sqlite3_mutex *mutex; /* Non-recursive mutex required to access this object */
Bitvec *pHasContent; /* Set of pages moved to free-list this transaction */
#ifndef SQLITE_OMIT_SHARED_CACHE
int nRef; /* Number of references to this structure */
@@ -435,6 +435,7 @@ struct BtShared {
Btree *pWriter; /* Btree with currently open write transaction */
u8 isExclusive; /* True if pWriter has an EXCLUSIVE lock on the db */
u8 isPending; /* If waiting for read-locks to clear */
u16 iMutexCounter; /* The number of mutex_leave(mutex) calls */
#endif
u8 *pTmpSpace; /* BtShared.pageSize bytes of space for tmp use */
};