Make SpinLock.TryEnter(ref bool) fail faster
authorStephen Toub <stoub@microsoft.com>
Tue, 31 Jan 2017 19:50:44 +0000 (14:50 -0500)
committerStephen Toub <stoub@microsoft.com>
Tue, 31 Jan 2017 21:13:19 +0000 (16:13 -0500)
commit7da8974f86a5329b97da9cb3af73a89d976ae0f2
treed38d7a14e30b0241c922f83e614b41ef3e5ac90c
parentdcd2b2faf591e97542aa792a177dec098df12f7a
Make SpinLock.TryEnter(ref bool) fail faster

One uses SpinLock.TryEnter(ref bool) when they want to do a quick test to either acquire the lock or know it's held by someone else.  We can make the latter path much faster so that it fails faster.

Commit migrated from https://github.com/dotnet/coreclr/commit/7ee26ae908da9b1f48c37186b07b3dc860f4f1ba
src/coreclr/src/mscorlib/src/System/Threading/SpinLock.cs