diff options
author | Koundinya Veluri <kouvel@users.noreply.github.com> | 2017-09-08 14:19:05 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-09-08 14:19:05 -0700 |
commit | 03260fda5966a8dda85dc116f9421ce1f0b436ef (patch) | |
tree | 49682d8405f6c068d527c7a6a173f5c03ed9f9ab /src | |
parent | 72201862c9b646ca651b686c5d7df9b71ca033e8 (diff) | |
download | coreclr-03260fda5966a8dda85dc116f9421ce1f0b436ef.tar.gz coreclr-03260fda5966a8dda85dc116f9421ce1f0b436ef.tar.bz2 coreclr-03260fda5966a8dda85dc116f9421ce1f0b436ef.zip |
Change lock used for initializing YieldProcessorNormalized from Crst to CrstStatic (#13857)
Fixes https://github.com/dotnet/coreclr/issues/13779
Diffstat (limited to 'src')
-rw-r--r-- | src/vm/threads.cpp | 4 | ||||
-rw-r--r-- | src/vm/threads.h | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp index abc544338b..91373930e9 100644 --- a/src/vm/threads.cpp +++ b/src/vm/threads.cpp @@ -1363,6 +1363,8 @@ void InitThreadManager() } CONTRACTL_END; + Thread::s_initializeYieldProcessorNormalizedCrst.Init(CrstLeafLock); + // All patched helpers should fit into one page. // If you hit this assert on retail build, there is most likely problem with BBT script. _ASSERTE_ALL_BUILDS("clr/src/VM/threads.cpp", (BYTE*)JIT_PatchedCodeLast - (BYTE*)JIT_PatchedCodeStart < (ptrdiff_t)GetOsPageSize()); @@ -11745,10 +11747,10 @@ ULONGLONG Thread::QueryThreadProcessorUsage() } #endif // FEATURE_APPDOMAIN_RESOURCE_MONITORING +CrstStatic Thread::s_initializeYieldProcessorNormalizedCrst; int Thread::s_yieldsPerNormalizedYield = 0; int Thread::s_optimalMaxNormalizedYieldsPerSpinIteration = 0; -static Crst s_initializeYieldProcessorNormalizedCrst(CrstLeafLock); void Thread::InitializeYieldProcessorNormalized() { LIMITED_METHOD_CONTRACT; diff --git a/src/vm/threads.h b/src/vm/threads.h index be36fe624e..4000f216f4 100644 --- a/src/vm/threads.h +++ b/src/vm/threads.h @@ -5364,6 +5364,7 @@ public: #endif // FEATURE_HIJACK private: + static CrstStatic s_initializeYieldProcessorNormalizedCrst; static int s_yieldsPerNormalizedYield; static int s_optimalMaxNormalizedYieldsPerSpinIteration; |