summaryrefslogtreecommitdiff
path: root/src/vm/frames.h
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2015-09-04 10:16:37 +0200
committerJan Vorlicek <janvorli@microsoft.com>2015-09-04 20:23:55 +0200
commit0aaf0a793e95fbef99c2c7e7e68fb3e1e91adcff (patch)
tree6138221c8d38af6ee7221fa984499b33bc23036b /src/vm/frames.h
parent1165038551b7ca20f230d867dc5fd2357ede14fe (diff)
downloadcoreclr-0aaf0a793e95fbef99c2c7e7e68fb3e1e91adcff.tar.gz
coreclr-0aaf0a793e95fbef99c2c7e7e68fb3e1e91adcff.tar.bz2
coreclr-0aaf0a793e95fbef99c2c7e7e68fb3e1e91adcff.zip
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.
Diffstat (limited to 'src/vm/frames.h')
-rw-r--r--src/vm/frames.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/vm/frames.h b/src/vm/frames.h
index ce65b38623..dcaa4403ff 100644
--- a/src/vm/frames.h
+++ b/src/vm/frames.h
@@ -3165,8 +3165,9 @@ private:
PTR_Object m_LastThrownObjectInParentContext;
ULONG_PTR m_LockCount; // Number of locks the thread takes
// before the transition.
+#ifndef FEATURE_CORECLR
ULONG_PTR m_CriticalRegionCount;
-
+#endif // !FEATURE_CORECLR
VPTR_VTABLE_CLASS(ContextTransitionFrame, Frame)
public:
@@ -3194,18 +3195,29 @@ public:
m_LastThrownObjectInParentContext = OBJECTREFToObject(lastThrownObject);
}
- void SetLockCount(DWORD lockCount, DWORD criticalRegionCount)
+ void SetLockCount(DWORD lockCount)
{
LIMITED_METHOD_CONTRACT;
m_LockCount = lockCount;
+ }
+ DWORD GetLockCount()
+ {
+ LIMITED_METHOD_CONTRACT;
+ return (DWORD) m_LockCount;
+ }
+
+#ifndef FEATURE_CORECLR
+ void SetCriticalRegionCount(DWORD criticalRegionCount)
+ {
+ LIMITED_METHOD_CONTRACT;
m_CriticalRegionCount = criticalRegionCount;
}
- void GetLockCount(DWORD* pLockCount, DWORD* pCriticalRegionCount)
+ DWORD GetCriticalRegionCount()
{
LIMITED_METHOD_CONTRACT;
- *pLockCount = (DWORD) m_LockCount;
- *pCriticalRegionCount = (DWORD) m_CriticalRegionCount;
+ return (DWORD) m_CriticalRegionCount;
}
+#endif // !FEATURE_CORECLR
// Let debugger know that we're transitioning between AppDomains.
ETransitionType GetTransitionType()
@@ -3220,7 +3232,9 @@ public:
, m_ReturnExecutionContext(NULL)
, m_LastThrownObjectInParentContext(NULL)
, m_LockCount(0)
+#ifndef FEATURE_CORECLR
, m_CriticalRegionCount(0)
+#endif // !FEATURE_CORECLR
{
LIMITED_METHOD_CONTRACT;
}