Remove thread affinity and critical region stuff for Unix
authorJan Vorlicek <janvorli@microsoft.com>
Fri, 4 Sep 2015 08:16:37 +0000 (10:16 +0200)
committerJan Vorlicek <janvorli@microsoft.com>
Fri, 4 Sep 2015 18:23:55 +0000 (20:23 +0200)
commit0aaf0a793e95fbef99c2c7e7e68fb3e1e91adcff
tree6138221c8d38af6ee7221fa984499b33bc23036b
parent1165038551b7ca20f230d867dc5fd2357ede14fe
Remove thread affinity and critical region stuff for Unix

The WaitHandleNative::CorWaitMultipleNative was calling Thread::BeginThreadAffinityAndCriticalRegion
that results in incrementing the Thread::m_dwCriticalRegionCount. However, there is nothing
that would decrement it on CoreCLR, so if the WaitHandleNative::CorWaitMultipleNative is called,
in debug build we get an assert in Thread::InternalReset.

It turns out that the critical region and thread affinity stuff is not to be used in CoreCLR,
so I have disabled handling of that in CoreCLR for Unix.
The only remainder are the static methods Thread::BeginThreadAffinity and Thread::EndThreadAffinity
which are used in the ThreadAffinityHolder. Conditionally removing the holder usage would be messy,
so I have rather kept those methods and made their bodies empty.
src/mscorlib/src/System/Threading/Thread.cs
src/mscorlib/src/System/Threading/WaitHandle.cs
src/vm/comisolatedstorage.cpp
src/vm/common.h
src/vm/comsynchronizable.cpp
src/vm/comsynchronizable.h
src/vm/comwaithandle.cpp
src/vm/frames.h
src/vm/threads.cpp
src/vm/threads.h