Fix sempahore spinning fix (#15002)
authorStephen Toub <stoub@microsoft.com>
Mon, 13 Nov 2017 06:12:44 +0000 (01:12 -0500)
committerJan Kotas <jkotas@microsoft.com>
Mon, 13 Nov 2017 06:12:44 +0000 (22:12 -0800)
commitcbcdbd25e74ff9d963eafa202dd63504ca537f7e
tree76b5af47c4c99349c11828166804e4b0b9fc3797
parent56ec8cb6dcbb0e7a844f2f3e37b646bb57a737db
Fix sempahore spinning fix (#15002)

A recent fix around SemaphoreSlim's spinning has led to it spinning even when spinning isn't necessary, resulting in measurable overheads when trying to acquire a semaphore that has count available.  This fixes that by putting back the check to avoid spinning if count is known to be available.
src/mscorlib/src/System/Threading/SemaphoreSlim.cs