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