private void AsyncCompleteCallback(AsyncRef asyncRef)
 {
     Monitor.Enter(this);
     try
     {
         realizing = false;
         prioritizer.Complete(this);
         activeAsyncRef.Dispose();
         activeAsyncRef = null;
     }
     finally
     {
         Monitor.Exit(this);
     }
 }
Пример #2
0
		public void AddCallback(AsyncRecord.CompleteCallback callback)
		{
			Monitor.Enter(this);
			try
			{
				if (this.present != null)
				{
					AsyncRef asyncRef = new AsyncRef(this, "AsyncRecord.AddCallback");
					callback(asyncRef);
					asyncRef.Dispose();
				}
				else
				{
					this.callbackEvent = (AsyncRecord.CompleteCallback)Delegate.Combine(this.callbackEvent, callback);
				}
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
Пример #3
0
 public void AddCallback(CompleteCallback callback)
 {
     Monitor.Enter(this);
     try
     {
         if (present != null)
         {
             AsyncRef asyncRef = new AsyncRef(this, "AsyncRecord.AddCallback");
             callback(asyncRef);
             asyncRef.Dispose();
         }
         else
         {
             callbackEvent = (CompleteCallback)Delegate.Combine(callbackEvent, callback);
         }
     }
     finally
     {
         Monitor.Exit(this);
     }
 }
Пример #4
0
 private void NotifyThread()
 {
     callbackEvent(notificationRef);
     notificationRef.Dispose();
 }