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

◆ TryEnter() [2/3]

void System.Threading.SpinLock.TryEnter ( ref bool lockTaken)
inline

Definition at line 103 of file SpinLock.cs.

104 {
105 int owner = _owner;
106 if (((owner & int.MinValue) == 0) | lockTaken)
107 {
108 ContinueTryEnter(0, ref lockTaken);
109 }
110 else if (((uint)owner & (true ? 1u : 0u)) != 0)
111 {
112 lockTaken = false;
113 }
114 else
115 {
116 CompareExchange(ref _owner, owner | 1, owner, ref lockTaken);
117 }
118 }
void ContinueTryEnter(int millisecondsTimeout, ref bool lockTaken)
Definition SpinLock.cs:139
static int CompareExchange(ref int location, int value, int comparand, ref bool success)
Definition SpinLock.cs:78

References System.Threading.SpinLock._owner, System.Threading.SpinLock.CompareExchange(), and System.Threading.SpinLock.ContinueTryEnter().

Referenced by System.Net.Http.FailedProxyCache.CleanupHelper(), System.Threading.SpinLock.TryEnter(), and System.Threading.ThreadPoolWorkQueue.WorkStealingQueue.TrySteal().