mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Changes to debugging code in mutex_unix.c and mutex_w32.c to make an assert() statement threadsafe.
FossilOrigin-Name: e82e32bd431ccacd276df8241592eb5519d87122
This commit is contained in:
@@ -235,6 +235,7 @@ static void pthreadMutexEnter(sqlite3_mutex *p){
|
||||
*/
|
||||
pthread_mutex_lock(&p->mutex);
|
||||
#if SQLITE_MUTEX_NREF
|
||||
assert( p->nRef>0 || p->owner==0 );
|
||||
p->owner = pthread_self();
|
||||
p->nRef++;
|
||||
#endif
|
||||
@@ -307,6 +308,7 @@ static void pthreadMutexLeave(sqlite3_mutex *p){
|
||||
assert( pthreadMutexHeld(p) );
|
||||
#if SQLITE_MUTEX_NREF
|
||||
p->nRef--;
|
||||
if( p->nRef==0 ) p->owner = 0;
|
||||
#endif
|
||||
assert( p->nRef==0 || p->id==SQLITE_MUTEX_RECURSIVE );
|
||||
|
||||
|
Reference in New Issue
Block a user