示例#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;
 }
示例#2
0
 public DebugView(AsyncCountdownEvent ce)
 {
     _ce = ce;
 }
示例#3
0
 /// <summary>
 /// Completes the deferral.
 /// </summary>
 void IDisposable.Dispose()
 {
     if (_count == null) {
         return;
     }
     _count.Signal();
     _count = null;
 }
示例#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;
 }