File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -312,10 +312,12 @@ public void Dispose()
312312 // only when the lock is fully unlocked.
313313 @this . _parent . _owningId = UnlockedId ;
314314 @this . _parent . _owningThreadId = ( int ) UnlockedId ;
315- if ( @this . _parent . _retry . CurrentCount == 0 )
316- {
317- @this . _parent . _retry . Release ( ) ;
318- }
315+ }
316+ // We can't place this within the _reentrances == 0 block above because we might
317+ // still need to notify a parallel reentrant task to wake. I think.
318+ if ( @this . _parent . _retry . CurrentCount == 0 )
319+ {
320+ @this . _parent . _retry . Release ( ) ;
319321 }
320322 }
321323 finally
@@ -401,7 +403,7 @@ public Task<bool> TryLockAsync(Func<Task> callback, TimeSpan timeout)
401403 } ) . Unwrap ( ) ;
402404 }
403405
404- // Make sure InnerLock.LockAsync () does not use await, because an async function triggers a snapshot of
406+ // Make sure InnerLock.TryLockAsync () does not use await, because an async function triggers a snapshot of
405407 // the AsyncLocal value.
406408 public Task < bool > TryLockAsync ( Action callback , CancellationToken cancel )
407409 {
You can’t perform that action at this time.
0 commit comments