public void Invoke(IScheduler scheduler)
 {
     //
     // Protect against possible maltreatment of the scheduler queues or races in
     // execution of a work item that got relocated across system clock changes.
     // Under no circumstance whatsoever we should run work twice. The monitor's
     // ref count should also be subject to this policy.
     //
     if (Interlocked.Exchange(ref _hasRun, 1) == 0)
     {
         try
         {
             if (!Disposable.GetIsDisposed(ref _disposable))
             {
                 Disposable.SetSingle(ref _disposable, InvokeCore(scheduler));
             }
         }
         finally
         {
             SystemClock.Release();
         }
     }
 }
示例#2
0
 private bool IsDisposed()
 {
     return(Disposable.GetIsDisposed(ref _upstream));
 }
示例#3
0
 bool IsDisposed()
 {
     return(Disposable.GetIsDisposed(ref upstream));
 }