public AsyncManualResetEvent(bool set) { _mutex = new object(); _tcs = TaskCompletionSourceExtensions.CreateAsyncTaskSource <object>(); if (set) { _tcs.TrySetResult(null !); } }
public void Reset() { lock (_mutex) { if (_tcs.Task.IsCompleted) { _tcs = TaskCompletionSourceExtensions.CreateAsyncTaskSource <object>(); } } }