diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2015-12-15 15:45:48 +0300 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2016-01-12 19:41:10 +0300 |
commit | 9e0eb8b241fc53cc0d1969f78985ec6d31e42820 (patch) | |
tree | b3a8e56e6fad59e3796ed3521de374cf4308bf47 /src/Native/Runtime/Crst.cpp | |
parent | a3526d82f27410166dcc21c173de4cd4d80f4cdd (diff) |
GC to OS interface refactoring
Port changes from CoreCLR
Update Runtime as needed
Remove functions that are not needed anymore for Unix
Diffstat (limited to 'src/Native/Runtime/Crst.cpp')
-rw-r--r-- | src/Native/Runtime/Crst.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/Native/Runtime/Crst.cpp b/src/Native/Runtime/Crst.cpp index 6593769f4..8b30def85 100644 --- a/src/Native/Runtime/Crst.cpp +++ b/src/Native/Runtime/Crst.cpp @@ -10,20 +10,13 @@ #include "holder.h" #include "Crst.h" -#ifndef DACCESS_COMPILE -bool EEThreadId::IsSameThread() -{ - return PalGetCurrentThreadId() == m_uiId; -} -#endif // DACCESS_COMPILE - void CrstStatic::Init(CrstType eType, CrstFlags eFlags) { UNREFERENCED_PARAMETER(eType); UNREFERENCED_PARAMETER(eFlags); #ifndef DACCESS_COMPILE #if defined(_DEBUG) - m_uiOwnerId = UNOWNED; + m_uiOwnerId.Clear(); #endif // _DEBUG PalInitializeCriticalSectionEx(&m_sCritSec, 0, 0); #endif // !DACCESS_COMPILE @@ -42,7 +35,7 @@ void CrstStatic::Enter(CrstStatic *pCrst) #ifndef DACCESS_COMPILE PalEnterCriticalSection(&pCrst->m_sCritSec); #if defined(_DEBUG) - pCrst->m_uiOwnerId = PalGetCurrentThreadId(); + pCrst->m_uiOwnerId.SetToCurrentThread(); #endif // _DEBUG #else UNREFERENCED_PARAMETER(pCrst); @@ -54,7 +47,7 @@ void CrstStatic::Leave(CrstStatic *pCrst) { #ifndef DACCESS_COMPILE #if defined(_DEBUG) - pCrst->m_uiOwnerId = UNOWNED; + pCrst->m_uiOwnerId.Clear(); #endif // _DEBUG PalLeaveCriticalSection(&pCrst->m_sCritSec); #else @@ -66,7 +59,7 @@ void CrstStatic::Leave(CrstStatic *pCrst) bool CrstStatic::OwnedByCurrentThread() { #ifndef DACCESS_COMPILE - return m_uiOwnerId == PalGetCurrentThreadId(); + return m_uiOwnerId.IsCurrentThread(); #else return false; #endif @@ -74,6 +67,6 @@ bool CrstStatic::OwnedByCurrentThread() EEThreadId CrstStatic::GetHolderThreadId() { - return EEThreadId(m_uiOwnerId); + return m_uiOwnerId; } #endif // _DEBUG |