We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78ba6bf commit f11bf59Copy full SHA for f11bf59
src/DotNext.Threading/Threading/IAsyncEvent.cs
@@ -1,5 +1,7 @@
1
namespace DotNext.Threading;
2
3
+using static Tasks.Synchronization;
4
+
5
/// <summary>
6
/// Represents asynchronous event.
7
/// </summary>
@@ -55,8 +57,5 @@ public interface IAsyncEvent : IDisposable, IResettable
55
57
/// <exception cref="ObjectDisposedException">The current instance has already been disposed.</exception>
56
58
/// <exception cref="ArgumentOutOfRangeException"><paramref name="timeout"/> is negative.</exception>
59
bool Wait(TimeSpan timeout)
- {
- using var task = WaitAsync(timeout).AsTask();
60
- return task.Wait(timeout);
61
- }
+ => WaitAsync(timeout).Wait();
62
}
0 commit comments