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

Changes to ensure that when running in shared-cache mode with a non-threadsafe build, the correct busy-handler callback is always invoked. (CVS 6481)

FossilOrigin-Name: 683e4bd74783e6e3f6cf75f9582008c7b7e02a01
This commit is contained in:
danielk1977
2009-04-10 12:55:16 +00:00
parent 2a50ff0309
commit f7590db099
7 changed files with 85 additions and 41 deletions

View File

@@ -13,7 +13,7 @@
** subsystem. See comments in the source code for a detailed description
** of what each interface routine does.
**
** @(#) $Id: btree.h,v 1.112 2009/04/02 20:16:59 drh Exp $
** @(#) $Id: btree.h,v 1.113 2009/04/10 12:55:17 danielk1977 Exp $
*/
#ifndef _BTREE_H_
#define _BTREE_H_
@@ -186,42 +186,39 @@ void sqlite3BtreeCursorList(Btree*);
** use mutexes to access the BtShared structures. So make the
** Enter and Leave procedures no-ops.
*/
#if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE
#ifndef SQLITE_OMIT_SHARED_CACHE
void sqlite3BtreeEnter(Btree*);
void sqlite3BtreeLeave(Btree*);
#ifndef NDEBUG
/* This routine is used inside assert() statements only. */
int sqlite3BtreeHoldsMutex(Btree*);
void sqlite3BtreeEnterAll(sqlite3*);
#else
# define sqlite3BtreeEnter(X)
# define sqlite3BtreeEnterAll(X)
#endif
#if !defined(SQLITE_OMIT_SHARED_CACHE) && SQLITE_THREADSAFE
void sqlite3BtreeLeave(Btree*);
void sqlite3BtreeEnterCursor(BtCursor*);
void sqlite3BtreeLeaveCursor(BtCursor*);
void sqlite3BtreeEnterAll(sqlite3*);
void sqlite3BtreeLeaveAll(sqlite3*);
#ifndef NDEBUG
/* This routine is used inside assert() statements only. */
int sqlite3BtreeHoldsAllMutexes(sqlite3*);
#endif
void sqlite3BtreeMutexArrayEnter(BtreeMutexArray*);
void sqlite3BtreeMutexArrayLeave(BtreeMutexArray*);
void sqlite3BtreeMutexArrayInsert(BtreeMutexArray*, Btree*);
#else
# define sqlite3BtreeEnter(X)
# define sqlite3BtreeLeave(X)
#ifndef NDEBUG
/* This routine is used inside assert() statements only. */
# define sqlite3BtreeHoldsMutex(X) 1
/* These routines are used inside assert() statements only. */
int sqlite3BtreeHoldsMutex(Btree*);
int sqlite3BtreeHoldsAllMutexes(sqlite3*);
#endif
#else
# define sqlite3BtreeLeave(X)
# define sqlite3BtreeEnterCursor(X)
# define sqlite3BtreeLeaveCursor(X)
# define sqlite3BtreeEnterAll(X)
# define sqlite3BtreeLeaveAll(X)
#ifndef NDEBUG
/* This routine is used inside assert() statements only. */
# define sqlite3BtreeHoldsAllMutexes(X) 1
#endif
# define sqlite3BtreeMutexArrayEnter(X)
# define sqlite3BtreeMutexArrayLeave(X)
# define sqlite3BtreeMutexArrayInsert(X,Y)
# define sqlite3BtreeHoldsMutex(X) 1
# define sqlite3BtreeHoldsAllMutexes(X) 1
#endif