You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here it registered a cancel callback, but it never dispose even when lock is acquired, ct would hold on to all the tcs until it's cancelled. In my case I create one CancellationTokenSource, only Cancel when the app is closed, if any race condition happen it would add a registration to the linked list inside cts
maybe add something like this:
if(ct!=default){varregistration=ct.Register(()=>tcs.TrySetCanceled());tcs.Task.ContinueWith(_ =>registration.Dispose(),TaskContinuationOptions.ExecuteSynchronously);// dispose registration after task completion}
Hi, @kekyo , I'm looking through your code,
FlashCap/FlashCap.Core/Internal/AsyncLock.cs
Line 47 in 854186a
here it registered a cancel callback, but it never dispose even when lock is acquired, ct would hold on to all the tcs until it's cancelled. In my case I create one CancellationTokenSource, only Cancel when the app is closed, if any race condition happen it would add a registration to the linked list inside cts
maybe add something like this:
I see it was done in AsyncEx lib
https://github.com/StephenCleary/AsyncEx/blob/master/src/Nito.AsyncEx.Coordination/AsyncWaitQueue.cs#L82
The text was updated successfully, but these errors were encountered: