6[DebuggerTypeProxy(typeof(SystemThreading_SpinLockDebugView))]
7[DebuggerDisplay(
"IsHeld = {IsHeld}")]
81 success = num == comparand;
85 public SpinLock(
bool enableThreadOwnerTracking)
88 if (!enableThreadOwnerTracking)
94 public void Enter(ref
bool lockTaken)
97 if (lockTaken || (owner & -2147483647) !=
int.MinValue ||
CompareExchange(ref
_owner, owner | 1, owner, ref lockTaken) != owner)
106 if (((owner &
int.MinValue) == 0) | lockTaken)
110 else if (((uint)owner & (
true ? 1u : 0u)) != 0)
122 long num = (long)
timeout.TotalMilliseconds;
123 if (num < -1 || num >
int.MaxValue)
160 int num =
int.MaxValue;
162 if ((owner & 1) == 0)
175 if ((owner & 0x7FFFFFFE) != 2147483646)
189 if ((owner & 1) == 0)
191 int value = (((owner & 0x7FFFFFFE) == 0) ? (owner | 1) : ((owner - 2) | 1));
220 if (
_owner == currentManagedThreadId)
248 if ((
_owner &
int.MinValue) == 0)
258 public void Exit(
bool useMemoryBarrier)
261 if ((owner &
int.MinValue) != 0 && !useMemoryBarrier)
273 bool flag = (
_owner &
int.MinValue) == 0;
278 if (useMemoryBarrier)
static int ProcessorCount
static int CurrentManagedThreadId
static string SpinLock_Exit_SynchronizationLockException
static string SpinLock_TryEnter_LockRecursionException
static string SpinLock_IsHeldByCurrentThread
static string SpinLock_TryEnter_ArgumentOutOfRange
static string SpinLock_TryReliableEnter_ArgumentException
static int CompareExchange(ref int location1, int value, int comparand)
static int Exchange(ref int location1, int value)
static int Decrement(ref int location)
static int Add(ref int location1, int value)
bool? IsHeldByCurrentThread
SystemThreading_SpinLockDebugView(SpinLock spinLock)
static int UpdateTimeOut(uint startTime, int originalWaitMillisecondsTimeout)
void TryEnter(ref bool lockTaken)
void Enter(ref bool lockTaken)
SpinLock(bool enableThreadOwnerTracking)
bool IsHeldByCurrentThread
bool IsThreadOwnerTrackingEnabled
void ContinueTryEnterWithThreadTracking(int millisecondsTimeout, uint startTime, ref bool lockTaken)
void ContinueTryEnter(int millisecondsTimeout, ref bool lockTaken)
void TryEnter(int millisecondsTimeout, ref bool lockTaken)
void ExitSlowPath(bool useMemoryBarrier)
static int CompareExchange(ref int location, int value, int comparand, ref bool success)
void Exit(bool useMemoryBarrier)
void TryEnter(TimeSpan timeout, ref bool lockTaken)