public static INonBlockingSemaphore Add(string name, int maxResources)
        {
            INonBlockingSemaphore semaphore = Factory.Create(name, maxResources);

            Repository.Add(name, semaphore);
            return(semaphore);
        }
        public override void Start()
        {
            if (this.semaphore == null)
            {
                this.semaphore = NonBlockingSemaphoreRepository.Get(this.Name);
            }

            this.semaphoreAcquired = this.semaphore.Acquire();
            base.Start();
        }
 public override void Reset()
 {
     base.Reset();
     this.semaphore         = null;
     this.semaphoreAcquired = false;
 }