1
0
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:
dan
2010-08-10 07:12:26 +00:00
parent 9b8d02727a
commit 84612fec1c
4 changed files with 14 additions and 10 deletions

View File

@@ -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 );