diff --git a/sdk/openai/Azure.AI.OpenAI/src/Helpers/AsyncAutoResetEvent.cs b/sdk/openai/Azure.AI.OpenAI/src/Helpers/AsyncAutoResetEvent.cs index 96b3ff814db4c..7cf4b6681fda9 100644 --- a/sdk/openai/Azure.AI.OpenAI/src/Helpers/AsyncAutoResetEvent.cs +++ b/sdk/openai/Azure.AI.OpenAI/src/Helpers/AsyncAutoResetEvent.cs @@ -8,9 +8,8 @@ namespace Azure.AI.OpenAI { // Adapted from https://devblogs.microsoft.com/pfxteam/building-async-coordination-primitives-part-2-asyncautoresetevent/ - internal class AsyncAutoResetEvent + internal sealed class AsyncAutoResetEvent { - private static readonly Task s_completed = Task.FromResult(true); private readonly Queue> _waits = new Queue>(); private bool _signaled; @@ -21,7 +20,7 @@ public Task WaitAsync(CancellationToken cancellationToken = default) if (_signaled) { _signaled = false; - return s_completed; + return Task.CompletedTask; } else {