summaryrefslogtreecommitdiff
path: root/src/vm/finalizerthread.cpp
diff options
context:
space:
mode:
authorKoundinya Veluri <kouvel@users.noreply.github.com>2017-09-19 13:54:37 -0700
committerGitHub <noreply@github.com>2017-09-19 13:54:37 -0700
commitca013149100a9ccc69a5df5b80f29fed2b1b0ce8 (patch)
tree808684bac8867718cf851025864d52034870fed6 /src/vm/finalizerthread.cpp
parentfe537afa6a655fd8359d214a4ca6da63ee1c45f5 (diff)
downloadcoreclr-ca013149100a9ccc69a5df5b80f29fed2b1b0ce8.tar.gz
coreclr-ca013149100a9ccc69a5df5b80f29fed2b1b0ce8.tar.bz2
coreclr-ca013149100a9ccc69a5df5b80f29fed2b1b0ce8.zip
Move initialization of YieldProcessorNormalized to the finalizer thread (#14058)
Move initialization of YieldProcessorNormalized to the finalizer thread Fixes https://github.com/dotnet/coreclr/issues/13984 - Also moved relevant functions out of the Thread class as requested in the issue - For some reason, after moving the functions out of the Thread class, YieldProcessorNormalized was not getting inlined anymore. It seems to be important to have it be inlined such that the memory loads are hoisted out of outer loops. To remove the dependency on the compiler to do it (even with forceinline it's not possible to hoist sometimes, for instance InterlockedCompareExchnage loops), changed the signatures to do what is intended.
Diffstat (limited to 'src/vm/finalizerthread.cpp')
-rw-r--r--src/vm/finalizerthread.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vm/finalizerthread.cpp b/src/vm/finalizerthread.cpp
index 3ba3468407..2955decbd7 100644
--- a/src/vm/finalizerthread.cpp
+++ b/src/vm/finalizerthread.cpp
@@ -744,6 +744,8 @@ DWORD WINAPI FinalizerThread::FinalizerThreadStart(void *args)
#endif
GetFinalizerThread()->SetBackground(TRUE);
+ EnsureYieldProcessorNormalizedInitialized();
+
#ifdef FEATURE_PROFAPI_ATTACH_DETACH
// Add the Profiler Attach Event to the array of event handles that the
// finalizer thread waits on. If the process is not enabled for profiler