Esempio n. 1
0
        public LowLevelLock()
        {
#if DEBUG
            _ownerThread = null;
#endif

            _spinWaiter = new LowLevelSpinWaiter();
            _spinWaitTryAcquireCallback = SpinWaitTryAcquireCallback;
            _monitor = new LowLevelMonitor();
        }
            public ThreadWaitInfo(RuntimeThread thread)
            {
                Debug.Assert(thread != null);

                _thread      = thread;
                _waitMonitor = new LowLevelMonitor();
                _waitedObjectIndexThatSatisfiedWait = -1;
                _waitedObjects   = new WaitHandleArray <WaitableObject>(elementInitializer: null);
                _waitedListNodes = new WaitHandleArray <WaitedListNode>(i => new WaitedListNode(this, i));
            }
Esempio n. 3
0
            public ThreadWaitInfo(Thread thread)
            {
                Debug.Assert(thread != null);

                _thread          = thread;
                _waitMonitor     = new LowLevelMonitor();
                _waitSignalState = WaitSignalState.NotWaiting;
                _waitedObjectIndexThatSatisfiedWait = -1;

                // Preallocate to make waiting for single handle fault-free
                _waitedObjects   = new WaitableObject[1];
                _waitedListNodes = new WaitedListNode[1] {
                    new WaitedListNode(this, 0)
                };
            }