Lines Matching defs:mutex

553 ** This interface only reports on the compile-time mutex setting
1564 ** The mutex module within SQLite defines [sqlite3_mutex] to be an
1565 ** abstract type for a mutex object. The SQLite core never looks
1637 ** or modify this field while holding a particular static mutex.
1910 ** as a mutex) it returns an [error code] other than [SQLITE_OK].
2056 ** SQLite holds the [SQLITE_MUTEX_STATIC_MAIN] mutex when it invokes
2060 ** holds the [SQLITE_MUTEX_STATIC_MEM] mutex as long as the
2240 ** The argument specifies alternative low-level mutex routines to be used
2241 ** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of
2253 ** structure is filled with the currently defined mutex routines.)^
2254 ** This option can be used to overload the default mutex allocation
2255 ** routines with a wrapper used to track mutex usage for performance
4699 ** a mutex is held. An internal mutex is held for a protected
4700 ** sqlite3_value object but no mutex is held for an unprotected
4703 ** or if SQLite is run in one of reduced mutex modes
6703 ** threads should mutex-protect calls to this API and should make their own
6704 ** private copy of the result prior to releasing the mutex.
8063 ** of these mutex routines. An appropriate implementation
8080 ** macro defined (with "-DSQLITE_MUTEX_APPDEF=1"), then no mutex
8082 ** application must supply a custom mutex implementation using the
8088 ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc()
8090 ** mutex. The argument to sqlite3_mutex_alloc() must one of these
8112 ** a new mutex. ^The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
8114 ** The mutex implementation does not need to make a distinction
8116 ** not want to. SQLite will only request a recursive mutex in
8117 ** cases where it really needs one. If a faster non-recursive mutex
8118 ** implementation is available on the host platform, the mutex subsystem
8119 ** might return such a mutex in response to SQLITE_MUTEX_FAST.
8123 ** a pointer to a static preexisting mutex. ^Nine static mutexes are
8130 ** ^Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
8132 ** returns a different mutex on every call. ^For the static
8133 ** mutex types, the same mutex is returned on every call that has
8137 ** allocated dynamic mutex. Attempting to deallocate a static
8138 ** mutex results in undefined behavior.
8141 ** to enter a mutex. ^If another thread is already within the mutex,
8147 ** mutex must be exited an equal number of times before another thread
8148 ** can enter.)^ If the same thread tries to enter any mutex other
8157 ** ^The sqlite3_mutex_leave() routine exits a mutex that was
8159 ** is undefined if the mutex is not currently entered by the
8180 ** Usually, the default mutex implementations provided by SQLite are
8187 ** output variable when querying the system for the current mutex
8198 ** resources obtained by the mutex methods implementation, especially
8218 ** of a valid mutex handle. The implementations of the methods defined
8220 ** of passing a NULL pointer instead of a valid mutex handle are undefined
8231 ** allocation for a static mutex. ^However xMutexAlloc() may use SQLite
8232 ** memory allocation for a fast or recursive mutex.
8260 ** with the SQLITE_DEBUG flag. External mutex implementations
8264 ** These routines should return true if the mutex in their argument
8274 ** clearly the mutex cannot be held if it does not exist. But
8275 ** the reason the mutex does not exist is because the build is not
8293 ** next. Applications that override the built-in mutex logic must be
8318 ** CAPI3REF: Retrieve the mutex for a database connection
9394 ** backup is in progress might also cause a mutex deadlock.
13275 ** Reuse the STATIC_LRU for mutex access to sqlite3_temp_directory.
16673 /************** Include mutex.h in the middle of sqliteInt.h *****************/
16674 /************** Begin file mutex.h *******************************************/
16687 ** This file contains the common header for all mutex implementations.
16701 ** SQLITE_MUTEX_OMIT No mutex logic. Not even stubs. The
16747 /************** End of mutex.h ***********************************************/
16808 ** A thread must be holding a mutex on the corresponding Btree in order
16810 ** holding a mutex on the sqlite3 connection pointer that owns the Btree.
16811 ** For a TEMP Schema, only the connection mutex is required.
17014 sqlite3_mutex *mutex; /* Connection mutex */
17132 ** mutex, not by sqlite3.mutex. They are used by code in notify.c.
17721 ** to avoid deadlock issues involving multiple sqlite3.mutex mutexes.
17724 ** list without holding the corresponding sqlite3.mutex mutex.
19484 sqlite3_mutex_methods mutex; /* Low-level mutex interface */
22243 {0,0,0,0,0,0,0,0,0}, /* mutex */
22302 ** Access to this global variable is not mutex protected. This might
23137 ** mutex, or by the pcache1 mutex. The following array determines which.
23169 ** be holding the appropriate mutex.
23182 ** appropriate mutex. (Locking is checked by assert()).
23214 ** The caller must hold the appropriate mutex.
23317 sqlite3_mutex_enter(db->mutex);
23498 sqlite3_mutex_leave(db->mutex);
24023 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN);
24025 sqlite3_mutex_enter(mutex);
24040 sqlite3_mutex_leave(mutex);
25228 sqlite3_mutex *mutex;
25235 mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN);
25237 sqlite3_mutex_enter(mutex);
25242 sqlite3_mutex_leave(mutex);
25272 MUTEX_LOGIC(sqlite3_mutex *mutex;)
25281 MUTEX_LOGIC( mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); )
25282 sqlite3_mutex_enter(mutex);
25292 sqlite3_mutex_leave(mutex);
25300 MUTEX_LOGIC(sqlite3_mutex *mutex;)
25305 MUTEX_LOGIC( mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN); )
25306 sqlite3_mutex_enter(mutex);
25308 sqlite3_mutex_leave(mutex);
25846 sqlite3_mutex *mutex;
25952 ** hold the STATIC_MEM mutex when the routines here are invoked. */
25953 mem.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
25963 mem.mutex = 0;
26009 sqlite3_mutex_enter(mem.mutex);
26053 sqlite3_mutex_leave(mem.mutex);
26065 || mem.mutex!=0 );
26069 sqlite3_mutex_enter(mem.mutex);
26090 sqlite3_mutex_leave(mem.mutex);
26214 sqlite3_mutex_enter(mem.mutex);
26219 sqlite3_mutex_leave(mem.mutex);
26406 sqlite3_mutex *mutex;
26440 assert( sqlite3_mutex_held(mem3.mutex) );
26459 assert( sqlite3_mutex_held(mem3.mutex) );
26478 assert( sqlite3_mutex_held(mem3.mutex) );
26493 assert( sqlite3_mutex_held(mem3.mutex) );
26508 ** If the STATIC_MEM mutex is not already held, obtain it now. The mutex
26513 if( sqlite3GlobalConfig.bMemstat==0 && mem3.mutex==0 ){
26514 mem3.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
26516 sqlite3_mutex_enter(mem3.mutex);
26519 sqlite3_mutex_leave(mem3.mutex);
26528 assert( sqlite3_mutex_held(mem3.mutex) );
26529 sqlite3_mutex_leave(mem3.mutex);
26531 sqlite3_mutex_enter(mem3.mutex);
26544 assert( sqlite3_mutex_held(mem3.mutex) );
26561 assert( sqlite3_mutex_held(mem3.mutex) );
26608 assert( sqlite3_mutex_held(mem3.mutex) );
26649 assert( sqlite3_mutex_held(mem3.mutex) );
26730 assert( sqlite3_mutex_held(mem3.mutex) );
26869 mem3.mutex = 0;
26941 sqlite3_mutex_leave(mem3.mutex);
27083 sqlite3_mutex *mutex;
27153 assert( sqlite3_mutex_held(mem5.mutex) );
27168 ** Obtain or release the mutex needed to access global data structures.
27171 sqlite3_mutex_enter(mem5.mutex);
27174 sqlite3_mutex_leave(mem5.mutex);
27196 ** The caller has obtained a mutex prior to invoking this
27436 ** This routine is not threadsafe. The caller must be holding a mutex
27448 /* For the purposes of this routine, disable the mutex */
27449 mem5.mutex = 0;
27486 /* If a mutex is required for normal operation, allocate one */
27488 mem5.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
27499 mem5.mutex = 0;
27568 /************** Begin file mutex.c *******************************************/
27582 ** This file contains code that is common across all mutex implementations.
27588 ** For debugging purposes, record when the mutex subsystem is initialized
27590 ** allocate a mutex while the system is uninitialized.
27601 ** the implementation of a wrapper around the system default mutex
27605 ** mutex implementation. Except, if a mutex is configured by calling
27609 ** This type of mutex is used as the database handle mutex when testing
27615 ** is defined. Variable CheckMutex.mutex is a pointer to the real mutex
27616 ** allocated by the system mutex implementation. Variable iType is usually set
27617 ** to the type of mutex requested - SQLITE_MUTEX_RECURSIVE, SQLITE_MUTEX_FAST
27618 ** or one of the static mutex identifiers. Or, if this is a recursive mutex
27625 sqlite3_mutex *mutex;
27631 ** Pointer to real mutex methods object used by the CheckMutex
27638 return pGlobalMutexMethods->xMutexHeld(((CheckMutex*)p)->mutex);
27641 return pGlobalMutexMethods->xMutexNotheld(((CheckMutex*)p)->mutex);
27646 ** Initialize and deinitialize the mutex subsystem.
27658 ** Allocate a mutex.
27683 if( p->mutex==0 ){
27684 p->mutex = pGlobalMutexMethods->xMutexAlloc(iType);
27685 if( p->mutex==0 ){
27697 ** Free a mutex.
27709 pGlobalMutexMethods->xMutexFree(pCheck->mutex);
27720 ** Enter the mutex.
27725 if( SQLITE_OK==pGlobalMutexMethods->xMutexTry(pCheck->mutex) ){
27732 pGlobalMutexMethods->xMutexEnter(pCheck->mutex);
27736 ** Enter the mutex (do not block).
27740 return pGlobalMutexMethods->xMutexTry(pCheck->mutex);
27744 ** Leave the mutex.
27748 pGlobalMutexMethods->xMutexLeave(pCheck->mutex);
27772 ** Mark the SQLITE_MUTEX_RECURSIVE mutex passed as the only argument as
27776 if( sqlite3GlobalConfig.mutex.xMutexAlloc==checkMutexAlloc ){
27785 ** Initialize the mutex system.
27789 if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){
27791 ** install a mutex implementation via sqlite3_config() prior to
27796 sqlite3_mutex_methods *pTo = &sqlite3GlobalConfig.mutex;
27818 assert( sqlite3GlobalConfig.mutex.xMutexInit );
27819 rc = sqlite3GlobalConfig.mutex.xMutexInit();
27830 ** Shutdown the mutex system. This call frees resources allocated by
27835 if( sqlite3GlobalConfig.mutex.xMutexEnd ){
27836 rc = sqlite3GlobalConfig.mutex.xMutexEnd();
27847 ** Retrieve a pointer to a static mutex or allocate a new dynamic one.
27854 assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
27855 return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
27863 assert( sqlite3GlobalConfig.mutex.xMutexAlloc );
27864 return sqlite3GlobalConfig.mutex.xMutexAlloc(id);
27868 ** Free a dynamic mutex.
27872 assert( sqlite3GlobalConfig.mutex.xMutexFree );
27873 sqlite3GlobalConfig.mutex.xMutexFree(p);
27878 ** Obtain the mutex p. If some other thread already has the mutex, block
27883 assert( sqlite3GlobalConfig.mutex.xMutexEnter );
27884 sqlite3GlobalConfig.mutex.xMutexEnter(p);
27889 ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
27890 ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
27895 assert( sqlite3GlobalConfig.mutex.xMutexTry );
27896 return sqlite3GlobalConfig.mutex.xMutexTry(p);
27902 ** The sqlite3_mutex_leave() routine exits a mutex that was previously
27903 ** entered by the same thread. The behavior is undefined if the mutex
27909 assert( sqlite3GlobalConfig.mutex.xMutexLeave );
27910 sqlite3GlobalConfig.mutex.xMutexLeave(p);
27920 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld );
27921 return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p);
27924 assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld );
27925 return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p);
27931 /************** End of mutex.c ***********************************************/
27950 ** mutex routines at start-time using the
27966 ** Stub routines for all mutex methods.
28010 ** The mutex object
28013 int id; /* The mutex type */
28031 ** Initialize and deinitialize the mutex subsystem.
28038 ** mutex and returns a pointer to it. If it returns NULL
28039 ** that means that a mutex could not be allocated.
28070 ** This routine deallocates a previously allocated mutex.
28086 ** to enter a mutex. If another thread is already within the mutex,
28091 ** mutex must be exited an equal number of times before another thread
28092 ** can enter. If the same thread tries to enter any other kind of mutex
28108 ** The sqlite3_mutex_leave() routine exits a mutex that was
28110 ** is undefined if the mutex is not currently entered or
28139 ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation
28189 ** Each recursive mutex is an instance of the following structure.
28192 pthread_mutex_t mutex; /* Mutex controlling the lock */
28198 volatile pthread_t owner; /* Thread that is within this mutex */
28250 ** Initialize and deinitialize the mutex subsystem.
28257 ** mutex and returns a pointer to it. If it returns NULL
28258 ** that means that a mutex could not be allocated. SQLite
28280 ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
28282 ** The mutex implementation does not need to make a distinction
28284 ** not want to. But SQLite will only request a recursive mutex in
28285 ** cases where it really needs one. If a faster non-recursive mutex
28286 ** implementation is available on the host platform, the mutex subsystem
28287 ** might return such a mutex in response to SQLITE_MUTEX_FAST.
28290 ** a pointer to a static preexisting mutex. Six static mutexes are
28297 ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
28299 ** returns a different mutex on every call. But for the static
28300 ** mutex types, the same mutex is returned on every call that has
28326 pthread_mutex_init(&p->mutex, 0);
28328 /* Use a recursive mutex if it is available */
28332 pthread_mutex_init(&p->mutex, &recursiveAttr);
28344 pthread_mutex_init(&p->mutex, 0);
28371 ** allocated mutex. SQLite is careful to deallocate every
28372 ** mutex that it allocates.
28380 pthread_mutex_destroy(&p->mutex);
28392 ** to enter a mutex. If another thread is already within the mutex,
28397 ** mutex must be exited an equal number of times before another thread
28398 ** can enter. If the same thread tries to enter any other kind of mutex
28420 pthread_mutex_lock(&p->mutex);
28429 pthread_mutex_lock(&p->mutex);
28439 printf("enter mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef);
28463 }else if( pthread_mutex_trylock(&p->mutex)==0 ){
28475 if( pthread_mutex_trylock(&p->mutex)==0 ){
28488 printf("enter mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef);
28495 ** The sqlite3_mutex_leave() routine exits a mutex that was
28497 ** is undefined if the mutex is not currently entered or
28510 pthread_mutex_unlock(&p->mutex);
28513 pthread_mutex_unlock(&p->mutex);
28518 printf("leave mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef);
28674 ** Each recursive mutex is an instance of the following structure.
28677 CRITICAL_SECTION mutex; /* Mutex controlling the lock */
28681 volatile DWORD owner; /* Thread holding this mutex */
28687 ** These are the initializer values used when declaring a "static" mutex
28737 ** Initialize and deinitialize the mutex subsystem.
28772 InitializeCriticalSectionEx(&winMutex_staticMutexes[i].mutex, 0, 0);
28774 InitializeCriticalSection(&winMutex_staticMutexes[i].mutex);
28795 DeleteCriticalSection(&winMutex_staticMutexes[i].mutex);
28805 ** mutex and returns a pointer to it. If it returns NULL
28806 ** that means that a mutex could not be allocated. SQLite
28828 ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
28830 ** The mutex implementation does not need to make a distinction
28832 ** not want to. But SQLite will only request a recursive mutex in
28833 ** cases where it really needs one. If a faster non-recursive mutex
28834 ** implementation is available on the host platform, the mutex subsystem
28835 ** might return such a mutex in response to SQLITE_MUTEX_FAST.
28838 ** a pointer to a static preexisting mutex. Six static mutexes are
28845 ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
28847 ** returns a different mutex on every call. But for the static
28848 ** mutex types, the same mutex is returned on every call that has
28866 InitializeCriticalSectionEx(&p->mutex, 0, 0);
28868 InitializeCriticalSection(&p->mutex);
28896 ** allocated mutex. SQLite is careful to deallocate every
28897 ** mutex that it allocates.
28903 DeleteCriticalSection(&p->mutex);
28914 ** to enter a mutex. If another thread is already within the mutex,
28919 ** mutex must be exited an equal number of times before another thread
28920 ** can enter. If the same thread tries to enter any other kind of mutex
28934 EnterCriticalSection(&p->mutex);
28940 OSTRACE(("ENTER-MUTEX tid=%lu, mutex(%d)=%p (%d), nRef=%d\n",
28971 if( winMutex_isNt && TryEnterCriticalSection(&p->mutex) ){
28983 OSTRACE(("TRY-MUTEX tid=%lu, mutex(%d)=%p (%d), owner=%lu, nRef=%d, rc=%s\n",
28991 ** The sqlite3_mutex_leave() routine exits a mutex that was
28993 ** is undefined if the mutex is not currently entered or
29009 LeaveCriticalSection(&p->mutex);
29012 OSTRACE(("LEAVE-MUTEX tid=%lu, mutex(%d)=%p (%d), nRef=%d\n",
29087 sqlite3_mutex *mutex; /* Mutex to serialize access */
29101 ** Return the memory allocator mutex. sqlite3_status() needs it.
29104 return mem0.mutex;
29144 sqlite3_mutex_enter(mem0.mutex);
29147 sqlite3_mutex_leave(mem0.mutex);
29156 sqlite3_mutex_leave(mem0.mutex);
29184 sqlite3_mutex_enter(mem0.mutex);
29192 sqlite3_mutex_leave(mem0.mutex);
29205 mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM);
29260 sqlite3_mutex_leave(mem0.mutex);
29262 sqlite3_mutex_enter(mem0.mutex);
29272 assert( sqlite3_mutex_held(mem0.mutex) );
29344 sqlite3_mutex_enter(mem0.mutex);
29346 sqlite3_mutex_leave(mem0.mutex);
29413 assert( sqlite3_mutex_held(db->mutex) );
29418 assert( sqlite3_mutex_held(db->mutex) );
29439 sqlite3_mutex_enter(mem0.mutex);
29443 sqlite3_mutex_leave(mem0.mutex);
29463 assert( db==0 || sqlite3_mutex_held(db->mutex) );
29503 assert( sqlite3_mutex_held(db->mutex) );
29539 assert( db==0 || sqlite3_mutex_held(db->mutex) );
29571 sqlite3_mutex_enter(mem0.mutex);
29578 sqlite3_mutex_leave(mem0.mutex);
29593 sqlite3_mutex_leave(mem0.mutex);
29690 assert( sqlite3_mutex_held(db->mutex) );
29726 assert( sqlite3_mutex_held(db->mutex) );
29745 assert( sqlite3_mutex_held(db->mutex) );
29926 /* If the db handle must hold the connection handle mutex here.
29931 assert( sqlite3_mutex_held(db->mutex) );
31262 ** mutex is held.
31267 ** memory mutex is held do not use these mechanisms.
32700 sqlite3_mutex *mutex;
32708 mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG);
32711 sqlite3_mutex_enter(mutex);
32714 sqlite3_mutex_leave(mutex);
32753 sqlite3_mutex_leave(mutex);
33251 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
37531 ** Helper functions to obtain and relinquish the global mutex. The
37532 ** global mutex is used to protect the unixInodeInfo and
37536 ** Function unixMutexHeld() is used to assert() that the global mutex
37545 ** before the unixInodeInfo.pLockMutex mutex, if both are held. It is
37547 ** that happens, the unixBigLock mutex must not be acquired until after
37557 assert( sqlite3_mutex_notheld(unixBigLock) ); /* Not a recursive mutex */
37964 ** (1) Only the pLockMutex mutex must be held in order to read or write
37969 ** be read (but not written) without holding any mutex:
37973 ** or written while holding the global unixBigLock mutex.
37975 ** Deadlock prevention: The global unixBigLock mutex may not
37976 ** be acquired while holding the pLockMutex mutex. If both unixBigLock
37981 sqlite3_mutex *pLockMutex; /* Hold this mutex for... */
38009 ** True if the inode mutex (on the unixFile.pFileMutex field) is held, or not.
38010 ** This routine is used only within assert() to help verify correct mutex
38139 ** The global mutex must be held when this routine is called, but the mutex
38175 ** The global mutex must held when calling this routine.
38556 /* This mutex is needed because pFile->pInode is shared across threads
38913 ** It is *not* necessary to hold the mutex when this routine is called,
38914 ** even on VxWorks. A mutex will be acquired on VxWorks by the
39778 /* This mutex is needed because pFile->pInode is shared across threads
41582 ** the cover of the unixEnterMutex() mutex and the pointer from the
41952 unixEnterMutex(); /* Also mutex, for redundancy */
42596 ** immediately, before releasing the mutex. findInodeInfo() may fail
44931 ** single thread. The memory allocation and mutex subsystems have not
46366 MUTEX_LOGIC( sqlite3_mutex *pMainMtx; ) /* The main static mutex */
46367 MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */
47321 ** Create the mutex and shared memory used for locking in the file
47341 ** to derive a mutex name. */
47347 /* Create/open the named mutex */
47356 /* Acquire the mutex before continuing */
47360 ** case-sensitive, take advantage of that by uppercasing the mutex name
47392 /* If shared memory could not be created, then close the mutex and fail */
47420 /* Acquire the mutex */
47442 /* Done with the mutex */
48751 ** Helper functions to obtain and relinquish the global mutex. The
48752 ** global mutex is used to protect the winLockInfo objects used by
48755 ** Function winShmMutexHeld() is used to assert() that the global mutex
48794 ** Either winShmNode.mutex must be held or winShmNode.nRef==0 and
48800 sqlite3_mutex *mutex; /* Mutex to access this object */
48840 ** All other fields are read/write. The winShm.pShmNode->mutex must be held
48846 u8 hasMutex; /* True if holding the winShmNode mutex */
48875 assert( pFile->nRef==0 || sqlite3_mutex_held(pFile->mutex) );
48924 if( p->mutex ){ sqlite3_mutex_free(p->mutex); }
49041 pShmNode->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST);
49042 if( pShmNode->mutex==0 ){
49077 ** the cover of the winShmEnterMutex() mutex and the pointer from the
49080 ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex
49081 ** mutex.
49083 sqlite3_mutex_enter(pShmNode->mutex);
49086 sqlite3_mutex_leave(pShmNode->mutex);
49119 sqlite3_mutex_enter(pShmNode->mutex);
49126 sqlite3_mutex_leave(pShmNode->mutex);
49171 sqlite3_mutex_enter(pShmNode->mutex);
49244 sqlite3_mutex_leave(pShmNode->mutex);
49262 winShmEnterMutex(); /* Also mutex, for redundancy */
49307 sqlite3_mutex_enter(pShmNode->mutex);
49424 sqlite3_mutex_leave(pShmNode->mutex);
49801 ** If sqlite3_temp_directory is defined, take the mutex and return true.
49803 ** If sqlite3_temp_directory is NULL (undefined), omit the mutex and
51330 ** SQLITE_MUTEX_STATIC_VFS1 mutex or while the object is not part
51333 ** * Other fields can only be changed while holding the .pMutex mutex
51456 ** Enter/leave the mutex on a MemStore
52124 sqlite3_mutex_enter(db->mutex);
52170 sqlite3_mutex_leave(db->mutex);
53684 ** unused pages from other PCaches) but it also operates without a mutex,
53685 ** and is therefore often faster. Mode 2 requires a mutex in order to be
53688 ** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single
53689 ** PGroup which is the pcache1.grp global variable and its mutex is
53693 sqlite3_mutex *mutex; /* MUTEX_STATIC_LRU or NULL */
53714 ** The PGroup mutex must be held when accessing nMax.
53729 ** when the accessor is holding the PGroup mutex.
53755 ** fixed at sqlite3_initialize() time and do not require mutex protection.
53756 ** The nFreeSlot and pFree values do require mutex protection.
53765 /* Above requires no mutex. Use mutex below for variable that follow. */
53766 sqlite3_mutex *mutex; /* Mutex for accessing the following: */
53769 /* The following value requires a mutex to change. We skip the mutex on
53784 ** Macros to enter and leave the PCache LRU mutex.
53787 # define pcache1EnterMutex(X) assert((X)->mutex==0)
53788 # define pcache1LeaveMutex(X) assert((X)->mutex==0)
53791 # define pcache1EnterMutex(X) sqlite3_mutex_enter((X)->mutex)
53792 # define pcache1LeaveMutex(X) sqlite3_mutex_leave((X)->mutex)
53876 ** in pcache1 need to be protected via mutex.
53880 assert( sqlite3_mutex_notheld(pcache1.grp.mutex) );
53882 sqlite3_mutex_enter(pcache1.mutex);
53892 sqlite3_mutex_leave(pcache1.mutex);
53902 sqlite3_mutex_enter(pcache1.mutex);
53905 sqlite3_mutex_leave(pcache1.mutex);
53920 sqlite3_mutex_enter(pcache1.mutex);
53928 sqlite3_mutex_leave(pcache1.mutex);
53936 sqlite3_mutex_enter(pcache1.mutex);
53938 sqlite3_mutex_leave(pcache1.mutex);
53970 assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
53978 /* The group mutex must be released before pcache1Alloc() is called. This
53980 ** this mutex is not held. */
54010 assert( sqlite3_mutex_held(p->pCache->pGroup->mutex) );
54069 ** The PCache mutex must be held when this function is called.
54076 assert( sqlite3_mutex_held(p->pGroup->mutex) );
54110 ** The PGroup mutex must be held when this function is called.
54117 assert( sqlite3_mutex_held(pPage->pCache->pGroup->mutex) );
54135 ** The PGroup mutex must be held when this function is called.
54142 assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
54158 assert( sqlite3_mutex_held(pGroup->mutex) );
54178 ** The PCache mutex must be held when this function is called.
54186 assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
54262 pcache1.grp.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_LRU);
54263 pcache1.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PMEM);
54281 ** Note that the static mutex allocated in xInit does
54533 ** the common case where pGroup->mutex is NULL. The pcache1Fetch() wrapper
54597 if( pCache->pGroup->mutex ){
54753 ** Return the global mutex used by this PCACHE implementation. The
54754 ** sqlite3_status() routine needs access to this mutex.
54757 return pcache1.mutex;
54772 assert( sqlite3_mutex_notheld(pcache1.grp.mutex) );
54773 assert( sqlite3_mutex_notheld(pcache1.mutex) );
65705 ** shared among multiple processes and not all mutex implementions work
67836 ** Access to all fields of this structure is controlled by the mutex
67837 ** stored in MemPage.pBt->mutex.
67905 ** All fields in this structure are accessed under sqlite3.mutex.
67909 ** they often do so without holding sqlite3.mutex.
67966 ** Fields in this structure are accessed under the BtShared.mutex
67967 ** mutex, except for nRef and pNext which are accessed under the
67968 ** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field
67970 ** The pSchema field may be set once under BtShared.mutex and
68016 sqlite3_mutex *mutex; /* Non-recursive mutex required to access this object */
68076 ** Fields in this structure are accessed under the BtShared.mutex
68077 ** found at self->pBt->mutex.
68305 ** Obtain the BtShared mutex associated with B-Tree handle p. Also,
68311 assert( sqlite3_mutex_notheld(p->pBt->mutex) );
68312 assert( sqlite3_mutex_held(p->db->mutex) );
68314 sqlite3_mutex_enter(p->pBt->mutex);
68320 ** Release the BtShared mutex associated with B-Tree handle p and
68326 assert( sqlite3_mutex_held(pBt->mutex) );
68327 assert( sqlite3_mutex_held(p->db->mutex) );
68330 sqlite3_mutex_leave(pBt->mutex);
68338 ** Enter a mutex on the given BTree object.
68340 ** If the object is not sharable, then no mutex is ever required
68341 ** and this routine is a no-op. The underlying mutex is non-recursive.
68369 assert( sqlite3_mutex_held(p->db->mutex) );
68394 if( sqlite3_mutex_try(p->pBt->mutex)==SQLITE_OK ){
68423 ** Exit the recursive mutex on a Btree.
68426 assert( sqlite3_mutex_held(p->db->mutex) );
68438 ** Return true if the BtShared mutex is held on the btree, or if the
68446 assert( p->sharable==0 || p->locked==0 || sqlite3_mutex_held(p->pBt->mutex) );
68447 assert( p->sharable==0 || p->locked==0 || sqlite3_mutex_held(p->db->mutex) );
68455 ** Enter the mutex on every Btree associated with a database
68472 assert( sqlite3_mutex_held(db->mutex) );
68488 assert( sqlite3_mutex_held(db->mutex) );
68501 ** mutex and all required BtShared mutexes.
68507 if( !sqlite3_mutex_held(db->mutex) ){
68514 (p->wantToLock==0 || !sqlite3_mutex_held(p->pBt->mutex)) ){
68528 ** (1) The mutex on db
68529 ** (2) if iDb!=1, then the mutex on db->aDb[iDb].pBt.
68540 if( !sqlite3_mutex_held(db->mutex) ) return 0;
68550 ** The following are special cases for mutex enter routines for use
68552 ** these two routines, all mutex operations are no-ops in that case and
68555 ** If shared cache is disabled, then all btree mutex routines, including
68575 ** Enter a mutex on a Btree given a cursor owned by that Btree.
69108 ** Verify that the cursor holds the mutex on its BtShared
69112 return sqlite3_mutex_held(p->pBt->mutex);
69141 assert( sqlite3_mutex_held(pBt->mutex) );
69378 assert( sqlite3_mutex_held(pBt->mutex) );
69592 assert( sqlite3_mutex_held(pBt->mutex) );
69622 assert( sqlite3_mutex_held(pBt->mutex) );
69679 assert( sqlite3_mutex_held(pBt->mutex) );
69799 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
69820 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
69901 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
70133 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
70329 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
70432 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
70530 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
70614 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
70731 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
70788 assert( sqlite3_mutex_held(pBt->mutex) );
70849 assert( sqlite3_mutex_held(pBt->mutex) );
70863 assert( sqlite3_mutex_held(pBt->mutex) );
70905 assert( sqlite3_mutex_held(pBt->mutex) );
70961 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
70974 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
71021 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
71042 assert( sqlite3_mutex_held(pBt->db->mutex) );
71101 assert( sqlite3_mutex_held(db->mutex) );
71283 pBt->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_FAST);
71284 if( pBt->mutex==0 ){
71374 assert( sqlite3_mutex_notheld(pBt->mutex) );
71391 sqlite3_mutex_free(pBt->mutex);
71459 assert( sqlite3_mutex_held(p->db->mutex) );
71489 ** it without having to hold the mutex.
71523 assert( sqlite3_mutex_held(p->db->mutex) );
71543 assert( sqlite3_mutex_held(p->db->mutex) );
71557 assert( sqlite3_mutex_held(p->db->mutex) );
71579 assert( sqlite3_mutex_held(p->db->mutex) );
71645 ** may only be called if it is guaranteed that the b-tree mutex is already
71649 ** known that the shared b-tree mutex is held, but the mutex on the
71656 assert( sqlite3_mutex_held(p->pBt->mutex) );
71818 assert( sqlite3_mutex_held(pBt->mutex) );
72023 assert( sqlite3_mutex_held(pBt->mutex) );
72044 assert( sqlite3_mutex_held(pBt->mutex) );
72314 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
72353 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
72431 assert( sqlite3_mutex_held(pBt->mutex) );
72514 assert( sqlite3_mutex_held(pBt->mutex) );
72686 assert( sqlite3_mutex_held(pBt->mutex) );
73472 assert( sqlite3_mutex_held(pBt->mutex) );
73847 assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
73873 ** Hence, a mutex on the BtShared should be held prior to calling
74120 assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
74142 assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
74212 assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
74443 assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
74664 assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
74894 assert( sqlite3_mutex_held(pBt->mutex) );
75209 assert( sqlite3_mutex_held(pBt->mutex) );
75355 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
75456 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
75641 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
75707 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
76268 assert( sqlite3_mutex_held(pPage->pBt->mutex) );
76536 assert( sqlite3_mutex_held(pBt->mutex) );
77298 assert( sqlite3_mutex_held(pBt->mutex) );
78436 assert( sqlite3_mutex_held(pBt->mutex) );
79459 ** open so it is safe to access without the BtShared mutex.
79472 ** open so it is safe to access without the BtShared mutex.
79484 assert( p==0 || sqlite3_mutex_held(p->db->mutex) );
79518 assert( sqlite3_mutex_held(p->db->mutex) );
79560 assert( sqlite3_mutex_held(p->db->mutex) );
79608 assert( sqlite3_mutex_held(pCsr->pBtree->db->mutex) );
79797 ** handle mutex and the mutex associated with the source BtShared
79802 ** the page cache associated with the source database. The mutex
79909 sqlite3_mutex_enter(pSrcDb->mutex);
79910 sqlite3_mutex_enter(pDestDb->mutex);
79953 sqlite3_mutex_leave(pDestDb->mutex);
79954 sqlite3_mutex_leave(pSrcDb->mutex);
79985 ** guaranteed that the shared-mutex is held by this thread, handle
80100 sqlite3_mutex_enter(p->pSrcDb->mutex);
80103 sqlite3_mutex_enter(p->pDestDb->mutex);
80335 sqlite3_mutex_leave(p->pDestDb->mutex);
80338 sqlite3_mutex_leave(p->pSrcDb->mutex);
80353 sqlite3_mutex_enter(pSrcDb->mutex);
80356 sqlite3_mutex_enter(p->pDestDb->mutex);
80431 ** It is assumed that the mutex associated with the BtShared object
80442 assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
80450 sqlite3_mutex_enter(p->pDestDb->mutex);
80452 sqlite3_mutex_leave(p->pDestDb->mutex);
80471 ** It is assumed that the mutex associated with the BtShared object
80478 assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) );
80762 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
80889 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
80918 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
80944 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
80972 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
81011 assert( sqlite3_mutex_held(pMem->db->mutex) );
81042 assert( sqlite3_mutex_held(pAccum->db->mutex) );
81064 assert( p->db==0 || sqlite3_mutex_held(p->db->mutex) );
81171 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
81200 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
81235 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
81261 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
81276 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
81328 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
81653 assert( pFrom->db==0 || sqlite3_mutex_held(pFrom->db->mutex) );
81654 assert( pTo->db==0 || sqlite3_mutex_held(pTo->db->mutex) );
81697 assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
81852 assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
81895 assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) );
84416 ** this routine obtains the mutex associated with each BtShared structure
86148 assert( sqlite3_mutex_held(db->mutex) );
87624 assert( sqlite3_mutex_held(db->mutex) );
87971 sqlite3_mutex_enter(db->mutex);
87997 sqlite3_mutex_enter(db->mutex);
88003 sqlite3_mutex_leave(db->mutex);
88016 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
88018 sqlite3_mutex_enter(mutex);
88027 sqlite3_mutex_leave(mutex);
88289 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88298 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88307 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88311 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88317 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88323 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88327 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88331 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88341 assert( sqlite3_mutex_held(pOut->db->mutex) );
88348 assert( sqlite3_mutex_held(pOut->db->mutex) );
88358 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88368 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88384 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88393 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88402 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88408 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88420 assert( sqlite3_mutex_held(pOut->db->mutex) );
88445 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88453 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88465 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88647 sqlite3_mutex_enter(db->mutex);
88649 sqlite3_mutex_leave(db->mutex);
88669 sqlite3_mutex_enter(db->mutex);
88734 sqlite3_mutex_leave(db->mutex);
88897 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
88919 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
88953 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
89071 sqlite3_mutex_enter(pVm->db->mutex);
89109 assert( sqlite3_mutex_held(p->db->mutex) );
89111 sqlite3_mutex_leave(p->db->mutex);
89220 sqlite3_mutex_enter(db->mutex);
89237 sqlite3_mutex_leave(db->mutex);
89333 ** A successful evaluation of this routine acquires the mutex on p.
89334 ** the mutex is released if any kind of error occurs.
89344 sqlite3_mutex_enter(p->db->mutex);
89347 sqlite3_mutex_leave(p->db->mutex);
89354 sqlite3_mutex_leave(p->db->mutex);
89406 sqlite3_mutex_leave(p->db->mutex);
89445 sqlite3_mutex_leave(p->db->mutex);
89458 sqlite3_mutex_leave(p->db->mutex);
89467 sqlite3_mutex_leave(p->db->mutex);
89483 sqlite3_mutex_leave(p->db->mutex);
89565 sqlite3_mutex_leave(p->db->mutex);
89572 sqlite3_mutex_enter(p->db->mutex);
89580 sqlite3_mutex_leave(p->db->mutex);
89627 sqlite3_mutex_enter(pTo->db->mutex);
89631 sqlite3_mutex_leave(pTo->db->mutex);
89714 sqlite3_mutex_enter(pDb->mutex);
89720 sqlite3_mutex_leave(pDb->mutex);
89740 sqlite3_mutex_enter(db->mutex);
89748 sqlite3_mutex_leave(db->mutex);
89781 sqlite3_mutex_enter(p->db->mutex);
89783 sqlite3_mutex_leave(p->db->mutex);
89797 sqlite3_mutex_enter(p->db->mutex);
89799 sqlite3_mutex_leave(p->db->mutex);
99409 sqlite3_mutex_enter(db->mutex);
99543 /* Make sure a mutex is held on the table to be accessed */
99606 sqlite3_mutex_leave(db->mutex);
99622 sqlite3_mutex_enter(db->mutex);
99624 sqlite3_mutex_leave(db->mutex);
99649 sqlite3_mutex_enter(db->mutex);
99703 sqlite3_mutex_leave(db->mutex);
99725 ** so no mutex is required for access.
99749 sqlite3_mutex_enter(db->mutex);
99769 sqlite3_mutex_leave(db->mutex);
117264 sqlite3_mutex_enter(db->mutex);
117268 sqlite3_mutex_leave(db->mutex);
131809 sqlite3_mutex_enter(db->mutex);
131902 sqlite3_mutex_leave(db->mutex);
133327 sqlite3_mutex_enter(db->mutex);
133330 sqlite3_mutex_leave(db->mutex);
133340 assert( sqlite3_mutex_held(db->mutex) );
133352 sqlite3_mutex_enter(db->mutex);
133358 sqlite3_mutex_leave(db->mutex);
133369 ** mutex must be held while accessing this list.
133410 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN);
133413 sqlite3_mutex_enter(mutex);
133429 sqlite3_mutex_leave(mutex);
133448 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN);
133453 sqlite3_mutex_enter(mutex);
133462 sqlite3_mutex_leave(mutex);
133475 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN);
133478 sqlite3_mutex_enter(mutex);
133482 sqlite3_mutex_leave(mutex);
133499 /* Common case: early out without every having to acquire a mutex */
133505 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MAIN);
133512 sqlite3_mutex_enter(mutex);
133519 sqlite3_mutex_leave(mutex);
137245 assert( sqlite3_mutex_held(db->mutex) );
137358 assert( sqlite3_mutex_held(db->mutex) );
137584 assert( sqlite3_mutex_held(db->mutex) );
137615 assert( sqlite3_mutex_held(db->mutex) );
137641 assert( sqlite3_mutex_held(db->mutex) );
137698 assert( sqlite3_mutex_held(db->mutex) );
137842 assert( sqlite3_mutex_held(db->mutex) );
137984 sqlite3_mutex_enter(db->mutex);
137999 sqlite3_mutex_leave(db->mutex);
138019 assert( sqlite3_mutex_held(sqlite3VdbeDb(p)->mutex) );
138023 assert( sqlite3_mutex_held(db->mutex) );
138138 sqlite3_mutex_enter(db->mutex);
138155 sqlite3_mutex_leave(db->mutex);
150032 sqlite3_mutex_enter(db->mutex);
150036 sqlite3_mutex_leave(db->mutex);
150173 /* Assert that the mutex (if any) associated with the BtShared database
150213 assert( sqlite3_mutex_held(db->mutex) );
150234 ** 1) By this function. In this case, all BtShared mutexes and the mutex
150238 ** the sqlite3.pDisconnect list. In this case either the BtShared mutex
150241 ** the database handle mutex is held.
150250 assert( sqlite3_mutex_held(db->mutex) );
150755 sqlite3_mutex_enter(db->mutex);
150759 sqlite3_mutex_leave(db->mutex);
150826 sqlite3_mutex_leave(db->mutex);
151248 sqlite3_mutex_enter(db->mutex);
151277 sqlite3_mutex_leave(db->mutex);
173580 ** VFS, and mutex subsystems prior to doing any serious work with
173608 MUTEX_LOGIC( sqlite3_mutex *pMainMtx; ) /* The main static mutex */
173636 /* Make sure the mutex subsystem is initialized. If unable to
173637 ** initialize the mutex subsystem, return early with the error.
173638 ** If the system is so sick that we are unable to allocate a mutex,
173641 ** The mutex subsystem must take care of serializing its own
173647 /* Initialize the malloc() system and the recursive pInitMutex mutex.
173648 ** This operation is protected by the STATIC_MAIN mutex. Note that
173649 ** MutexAlloc() is called for a static mutex prior to initializing the
173651 ** mutex must not require support from the malloc subsystem.
173676 ** the pInitMutex mutex. Return an error in either case. */
173681 /* Do the rest of the initialization under the recursive mutex so
173690 ** The following mutex is what serializes access to the appdef pcache xInit
173730 /* Go back under the static mutex and clean up the recursive
173731 ** mutex to prevent a resource leak.
173854 sqlite3GlobalConfig.bCoreMutex = 0; /* Disable mutex on core */
173855 sqlite3GlobalConfig.bFullMutex = 0; /* Disable mutex on connections */
173863 sqlite3GlobalConfig.bCoreMutex = 1; /* Enable mutex on core */
173864 sqlite3GlobalConfig.bFullMutex = 0; /* Disable mutex on connections */
173872 sqlite3GlobalConfig.bCoreMutex = 1; /* Enable mutex on core */
173873 sqlite3GlobalConfig.bFullMutex = 1; /* Enable mutex on connections */
173879 /* Specify an alternative mutex implementation */
173880 sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*);
173886 /* Retrieve the current mutex implementation */
173887 *va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex;
174253 ** Return the mutex associated with a database connection.
174262 return db->mutex;
174275 sqlite3_mutex_enter(db->mutex);
174285 sqlite3_mutex_leave(db->mutex);
174301 sqlite3_mutex_enter(db->mutex);
174315 sqlite3_mutex_leave(db->mutex);
174325 sqlite3_mutex_enter(db->mutex);
174414 sqlite3_mutex_leave(db->mutex);
174511 sqlite3_mutex_enter(db->mutex);
174513 sqlite3_mutex_leave(db->mutex);
174620 assert( sqlite3_mutex_held(db->mutex) );
174641 sqlite3_mutex_enter(db->mutex);
174664 sqlite3_mutex_leave(db->mutex);
174695 sqlite3_mutex_enter(db->mutex);
174708 sqlite3_mutex_leave(db->mutex);
174726 ** Close the mutex on database connection db.
174739 ** then just leave the mutex and return.
174742 sqlite3_mutex_leave(db->mutex);
174754 ** they are reset. And that the required b-tree mutex is held to make
174839 sqlite3_mutex_leave(db->mutex);
174841 sqlite3_mutex_free(db->mutex);
174860 assert( sqlite3_mutex_held(db->mutex) );
175163 sqlite3_mutex_enter(db->mutex);
175168 sqlite3_mutex_leave(db->mutex);
175190 sqlite3_mutex_enter(db->mutex);
175200 sqlite3_mutex_leave(db->mutex);
175259 assert( sqlite3_mutex_held(db->mutex) );
175398 sqlite3_mutex_enter(db->mutex);
175421 sqlite3_mutex_leave(db->mutex);
175488 sqlite3_mutex_enter(db->mutex);
175494 sqlite3_mutex_leave(db->mutex);
175547 sqlite3_mutex_enter(db->mutex);
175549 sqlite3_mutex_leave(db->mutex);
175576 sqlite3_mutex_enter(db->mutex);
175581 sqlite3_mutex_leave(db->mutex);
175599 sqlite3_mutex_enter(db->mutex);
175605 sqlite3_mutex_leave(db->mutex);
175631 sqlite3_mutex_enter(db->mutex);
175637 sqlite3_mutex_leave(db->mutex);
175661 sqlite3_mutex_enter(db->mutex);
175665 sqlite3_mutex_leave(db->mutex);
175686 sqlite3_mutex_enter(db->mutex);
175690 sqlite3_mutex_leave(db->mutex);
175711 sqlite3_mutex_enter(db->mutex);
175715 sqlite3_mutex_leave(db->mutex);
175731 sqlite3_mutex_enter(db->mutex);
175735 sqlite3_mutex_leave(db->mutex);
175756 sqlite3_mutex_enter(db->mutex);
175763 sqlite3_mutex_leave(db->mutex);
175835 sqlite3_mutex_enter(db->mutex);
175839 sqlite3_mutex_leave(db->mutex);
175880 sqlite3_mutex_enter(db->mutex);
175902 sqlite3_mutex_leave(db->mutex);
175929 ** The mutex on database handle db should be held by the caller. The mutex
175945 assert( sqlite3_mutex_held(db->mutex) );
176015 sqlite3_mutex_enter(db->mutex);
176026 sqlite3_mutex_leave(db->mutex);
176036 sqlite3_mutex_enter(db->mutex);
176038 sqlite3_mutex_leave(db->mutex);
176065 sqlite3_mutex_enter(db->mutex);
176081 sqlite3_mutex_leave(db->mutex);
176136 assert( sqlite3_mutex_held(db->mutex) );
176696 db->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
176697 if( db->mutex==0 ){
176703 sqlite3MutexWarnOnContention(db->mutex);
176706 sqlite3_mutex_enter(db->mutex);
176953 assert( db->mutex!=0 || isThreadsafe==0
176955 sqlite3_mutex_leave(db->mutex);
177075 sqlite3_mutex_enter(db->mutex);
177079 sqlite3_mutex_leave(db->mutex);
177100 sqlite3_mutex_enter(db->mutex);
177108 sqlite3_mutex_leave(db->mutex);
177125 sqlite3_mutex_enter(db->mutex);
177129 sqlite3_mutex_leave(db->mutex);
177146 sqlite3_mutex_enter(db->mutex);
177150 sqlite3_mutex_leave(db->mutex);
177274 sqlite3_mutex_enter(db->mutex);
177355 sqlite3_mutex_leave(db->mutex);
177382 sqlite3_mutex_enter(db->mutex);
177384 sqlite3_mutex_leave(db->mutex);
177398 sqlite3_mutex_enter(db->mutex);
177437 sqlite3_mutex_leave(db->mutex);
177815 sqlite3_mutex_enter(db->mutex);
177825 sqlite3_mutex_leave(db->mutex);
178199 sqlite3_mutex_enter(db->mutex);
178214 sqlite3_mutex_leave(db->mutex);
178235 sqlite3_mutex_enter(db->mutex);
178269 sqlite3_mutex_leave(db->mutex);
178289 sqlite3_mutex_enter(db->mutex);
178301 sqlite3_mutex_leave(db->mutex);
178405 ** mutex is held.
178478 ** Obtain the STATIC_MAIN mutex.
178486 ** Release the STATIC_MAIN mutex.
178522 sqlite3_mutex_enter(db->mutex);
178555 sqlite3_mutex_leave(db->mutex);
178602 enterMutex(); /* Enter STATIC_MAIN mutex */
178685 leaveMutex(); /* Leave STATIC_MAIN mutex */
209238 sqlite3_mutex *mutex; /* Mutex to protect pMain */
213246 ** to point to the new file. A mutex protected linked list of all main
213331 sqlite3_mutex_enter(pRbuVfs->mutex);
213343 sqlite3_mutex_leave(pRbuVfs->mutex);
213351 sqlite3_mutex_enter(p->pRbuVfs->mutex);
213358 sqlite3_mutex_leave(p->pRbuVfs->mutex);
213372 sqlite3_mutex_enter(pRbuVfs->mutex);
213378 sqlite3_mutex_leave(pRbuVfs->mutex);
213916 ** mutex protected linked list of all such files. */
214078 sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex);
214146 /* Allocate the mutex and register the new VFS (not as the default) */
214147 pNew->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_RECURSIVE);
214148 if( pNew->mutex==0 ){
214156 sqlite3_mutex_free(pNew->mutex);
217016 assert( sqlite3_mutex_held(db->mutex) );
217371 ** handle mutex. */
217415 ** database handle. Hold the db mutex while doing so. */
245731 sqlite3_mutex_enter(db->mutex);
245751 sqlite3_mutex_leave(db->mutex);
245817 sqlite3_mutex_enter(db->mutex);
245853 sqlite3_mutex_leave(db->mutex);
245924 sqlite3_mutex_enter(db->mutex);
245931 sqlite3_mutex_leave(db->mutex);
245952 sqlite3_mutex_enter(db->mutex);
245969 sqlite3_mutex_leave(db->mutex);
245973 sqlite3_mutex_leave(db->mutex);
245985 sqlite3_mutex_enter(db->mutex);
245996 sqlite3_mutex_leave(db->mutex);
246000 sqlite3_mutex_leave(db->mutex);
246012 sqlite3_mutex_enter(db->mutex);
246015 sqlite3_mutex_leave(db->mutex);
246019 sqlite3_mutex_leave(db->mutex);
246029 sqlite3_mutex_enter(db->mutex);
246037 sqlite3_mutex_leave(db->mutex);
246040 sqlite3_mutex_leave(db->mutex);