Exemple #1
0
 /// <summary>
 /// Gets a deferral. The deferral is complete when disposed.
 /// </summary>
 /// <returns>The deferral.</returns>
 public IDisposable GetDeferral()
 {
     if (_count == null) {
         _count = new AsyncCountdownEvent(1);
     }
     var ret = new Deferral(_count);
     _count.AddCount();
     return ret;
 }
Exemple #2
0
 public DebugView(AsyncCountdownEvent ce)
 {
     _ce = ce;
 }
Exemple #3
0
 /// <summary>
 /// Completes the deferral.
 /// </summary>
 void IDisposable.Dispose()
 {
     if (_count == null) {
         return;
     }
     _count.Signal();
     _count = null;
 }
Exemple #4
0
 /// <summary>
 /// Creates a new deferral referencing the countdown event of the deferral manager.
 /// </summary>
 /// <param name="count">The countdown event of the deferral manager.</param>
 public Deferral(AsyncCountdownEvent count)
 {
     _count = count;
 }