Skip to content

Commit

Permalink
Backport: Properly dispose the combined tokensource in the delayed me…
Browse files Browse the repository at this point in the history
…ssage poller (#623)
  • Loading branch information
DavidBoike authored Sep 20, 2023
1 parent d7ff8c3 commit 3f9cfee
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ async Task Loop(CancellationToken cancellationToken)
//After waiting we cancel the token so that the task waiting for the signal is cancelled and does not "eat" the next
//signal when it is raised in the next iteration of this loop
using (var waitCancelled = new CancellationTokenSource())
using (var combinedSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, waitCancelled.Token))
{
var combinedSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, waitCancelled.Token);

var waitTask = WaitIfNeeded(nextPoll.Value, combinedSource.Token);
var signalTask = WaitForSignal(combinedSource.Token);

Expand Down

0 comments on commit 3f9cfee

Please sign in to comment.