Ejemplo n.º 1
0
		public Trigger CreateTrigger()
		{
			Interlocked.Increment(ref _outstandingTriggers);
			SingleEntryGate triggerGate = new SingleEntryGate();

			return new Trigger(() => {
				if (triggerGate.TryEnter())
					HandleTriggerFired();
			});
		}
Ejemplo n.º 2
0
 private void HandleTriggerFired()
 {
     if (Interlocked.Decrement(ref _outstandingTriggers) == 0)
     {
         if (_continuationGate.TryEnter())
         {
             _continuation();
         }
     }
 }
Ejemplo n.º 3
0
        public Trigger CreateTrigger()
        {
            Interlocked.Increment(ref _outstandingTriggers);
            SingleEntryGate triggerGate = new SingleEntryGate();

            return(new Trigger(() => {
                if (triggerGate.TryEnter())
                {
                    HandleTriggerFired();
                }
            }));
        }