Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 public YieldUntilLock(params IGenericLock[] ManyLocks)
 {
     _Lock      = null;
     _ManyLocks = ManyLocks;
 }
Ejemplo n.º 3
0
 public YieldUntilLock(IGenericLock Lock)
 {
     _Lock      = Lock;
     _ManyLocks = null;
     _GotLock   = this.DoYieldUntilLock( );
 }