Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WaitAndAcquire()

void System.Threading.LowLevelLock.WaitAndAcquire ( )
inlineprivate

Definition at line 65 of file LowLevelLock.cs.

66 {
68 {
70 int num = Interlocked.Add(ref _state, 2);
71 while (((uint)num & (true ? 1u : 0u)) != 0 || Interlocked.CompareExchange(ref _state, num + -1, num) != num)
72 {
73 _monitor.Wait();
75 num = _state;
76 }
78 }
79 }
readonly Func< bool > _spinWaitTryAcquireCallback
LowLevelSpinWaiter _spinWaiter
bool SpinWaitForCondition(Func< bool > condition, int spinCount, int sleep0Threshold)

References System.Threading.LowLevelLock._isAnyWaitingThreadSignaled, System.Threading.LowLevelLock._monitor, System.Threading.LowLevelLock._spinWaiter, System.Threading.LowLevelLock._spinWaitTryAcquireCallback, System.Threading.LowLevelLock._state, System.Threading.LowLevelMonitor.Acquire(), System.Threading.Interlocked.Add(), System.Threading.Interlocked.CompareExchange(), System.Threading.LowLevelMonitor.Release(), System.Threading.LowLevelSpinWaiter.SpinWaitForCondition(), and System.Threading.LowLevelMonitor.Wait().

Referenced by System.Threading.LowLevelLock.Acquire().