diff options
Diffstat (limited to 'src/notify.c')
-rw-r--r-- | src/notify.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/notify.c b/src/notify.c index bfe8480d4..4c8ab0077 100644 --- a/src/notify.c +++ b/src/notify.c @@ -197,14 +197,9 @@ int sqlite3_unlock_notify( */ void sqlite3ConnectionBlocked(sqlite3 *db, sqlite3 *pBlocker){ enterMutex(); - if( db->pBlockingConnection==0 ){
- /*
- ** We can not register an unlock callback unless we think we are
- ** blocked.
- */
- assert( db->pUnlockConnection==0 );
- addToBlockedList(db);
- }
+ if( db->pBlockingConnection==0 && db->pUnlockConnection==0 ){ + addToBlockedList(db); + } db->pBlockingConnection = pBlocker; leaveMutex(); } @@ -307,15 +302,7 @@ void sqlite3ConnectionUnlocked(sqlite3 *db){ } /* Step 3. */ - if( p->pBlockingConnection==0 ){ - /*
- ** If we were blocked on db, we would set
- ** pBlockingConnection to 0 above. And we can
- ** only wait on a connection we are blocked on.
- ** So if we were waiting on db (pUnlockConnection==db)
- ** then it would have been set to 0 above as well.
- */
- assert( p->pUnlockConnection==0 );
+ if( p->pBlockingConnection==0 && p->pUnlockConnection==0 ){ /* Remove connection p from the blocked connections list. */ *pp = p->pNextBlocked; p->pNextBlocked = 0; |