From 26e71f32942f0ff1318799ac1c66c04babffbb3b Mon Sep 17 00:00:00 2001 From: bezzad Date: Sat, 4 Nov 2023 00:57:56 +0330 Subject: [PATCH] fixed deadlock issue in WaitToComplete method when buffer was already empty --- src/Downloader/ConcurrentPacketBuffer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Downloader/ConcurrentPacketBuffer.cs b/src/Downloader/ConcurrentPacketBuffer.cs index 8fbe7ca..7928763 100644 --- a/src/Downloader/ConcurrentPacketBuffer.cs +++ b/src/Downloader/ConcurrentPacketBuffer.cs @@ -105,7 +105,7 @@ private void ResumeAddingIfEmpty() public void WaitToComplete() { - _completionEvent.Wait(); + _completionEvent.Wait(TimeSpan.FromMilliseconds(100)); } public void CompleteAdding()