/// <summary>
        /// Attempt to lock the specified lock.
        /// If the lock is acquired, add the lock to the accumulated list of locks.
        /// Return the gotLock result.
        /// </summary>
        /// <param name="LockToLock"></param>
        /// <returns></returns>
        public bool Lock(IGenericLock LockToLock)
        {
            bool gotLock = LockToLock.Lock();

            if (gotLock == true)
            {
                AccumulatedLocks.Add(LockToLock);
            }
            else
            {
                this.GotAllLocks = false;
            }
            return(gotLock);
        }
Example #2
0
 public YieldUntilLock(params IGenericLock[] ManyLocks)
 {
     _Lock      = null;
     _ManyLocks = ManyLocks;
 }
Example #3
0
 public YieldUntilLock(IGenericLock Lock)
 {
     _Lock      = Lock;
     _ManyLocks = null;
     _GotLock   = this.DoYieldUntilLock( );
 }