Skip to content

Commit

Permalink
removed extra warning comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bezzad committed Nov 5, 2023
1 parent 88ad83b commit 6f5070c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Downloader/ConcurrentStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,10 @@ private async Task Watcher()
{
while (!_watcherCancelSource.IsCancellationRequested)
{
// Warning 1: When the Watcher() is here, at the same time Flush() is called,
// then the flush method checks if the queue is not empty,
// wait until will is empty. But, after checking the queue is not empty,
// immediately the below code is executed, and the last packet is consumed.
// So the last wait becomes deadlock!
var packet = await _inputBuffer.WaitTryTakeAsync(_watcherCancelSource.Token).ConfigureAwait(false);
if (packet != null)
{
// Warning 2: When the Watcher() is here, at the same time Flush() is called,
// Warning: When the Watcher() is here, at the same time Flush() is called,
// then the Flush method checks if the queue is empty, so break workflow.
// but, the stream is not still filled!

Expand Down

0 comments on commit 6f5070c

Please sign in to comment.