Пример #1
0
 public LockLevelException(LeveledLock currentLock, LeveledLock newLock) :
     base(string.Format("You attempted to violate the locking protocol by acquiring lock {0} " +
     "while the thread already owns lock {1}.", currentLock, newLock)) {}
Пример #2
0
        static void Test4()
        {
            LeveledLock la = new LeveledLock(10, false, "A");

            Console.WriteLine("Test4...");
            using (la.Enter())
            {
                Console.WriteLine("  Got A");
                using (la.Enter())
                {
                    Console.WriteLine("  Got A");
                }
                Console.WriteLine("  Released A");
            }
            Console.WriteLine("  Released A");
        }
Пример #3
0
 // Constructor
 internal LeveledLockCookie(LeveledLock lck)
 {
     this._lck = lck;
 }