Simplify TrySteal
authorStephen Toub <stoub@microsoft.com>
Wed, 1 Feb 2017 15:32:44 +0000 (10:32 -0500)
committerStephen Toub <stoub@microsoft.com>
Wed, 1 Feb 2017 15:32:44 +0000 (10:32 -0500)
commitfb378e2358a5ea7387b79cd2540bee646fe2759a
treea88d1999a9e14c44e52950f076f9df53ade3bb25
parentbd8b2362c8650b39acf735a6d09fba8a3fe739e2
Simplify TrySteal

- Use the newly updated SpinLock.TryEnter(ref bool) instead of TryEnter(int, ref bool), as the former is ~3x faster when the lock is already held.
- Change the method to avoid the out reference argument and instead just return it
- Simplify the logic to consolidate the setting of missedSteal

Commit migrated from https://github.com/dotnet/coreclr/commit/68ad7e2691bf99e4d14f475d1f1ecf7d713dc838
src/coreclr/src/mscorlib/src/System/Threading/ThreadPool.cs