diff --git a/EventHook/Helpers/AsyncQueue.cs b/EventHook/Helpers/AsyncQueue.cs index 7a22b69..19974b8 100644 --- a/EventHook/Helpers/AsyncQueue.cs +++ b/EventHook/Helpers/AsyncQueue.cs @@ -36,11 +36,8 @@ internal void Enqueue(T value) queue.Enqueue(value); //wake up the dequeue task with result - if (dequeueTask != null - && !dequeueTask.Task.IsCompleted) - { - dequeueTask.SetResult(true); - } + dequeueTask?.TrySetResult(true); + } ///