Exemple #1
0
        //
        // Constructors.
        //

        public StReadUpgradeWriteLock(StLockRecursionPolicy policy, int sc)
        {
            slock    = new SpinLock(SPIN_LOCK_SPINS);
            rdQueue  = new WaitNodeQueue();
            wrQueue  = new WaitNodeQueue();
            upQueue  = new WaitNodeQueue();
            rdCounts = new ReaderCounterTable();
            // writer = upgrader = UNOWNED;
            isReentrant = (policy == StLockRecursionPolicy.SupportsRecursion);
            spinCount   = Platform.IsMultiProcessor ? sc : 0;
        }
        //
        // Constructors.
        //

        public StReadUpgradeWriteLock(StLockRecursionPolicy policy, int sc) {
            slock = new SpinLock(SPIN_LOCK_SPINS);
            rdQueue = new WaitNodeQueue();
            wrQueue = new WaitNodeQueue();
            upQueue = new WaitNodeQueue();
            rdCounts = new ReaderCounterTable();
            // writer = upgrader = UNOWNED;         
            isReentrant = (policy == StLockRecursionPolicy.SupportsRecursion);
            spinCount = Platform.IsMultiProcessor ? sc : 0;
        }