Skip to content

Commit c3fa5fd

Browse files
committed
moved profiler init before FinalizerThreadCreate
1 parent e31a49a commit c3fa5fd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/coreclr/vm/ceemain.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,15 @@ void EEStartupHelper()
837837
InitializeDebugger(); // throws on error
838838
#endif // DEBUGGING_SUPPORTED
839839

840+
#ifdef PROFILING_SUPPORTED
841+
// Initialize the profiling services.
842+
// THis must happen before the finalizer thread is stopped on its first wait.
843+
hr = ProfilingAPIUtility::InitializeProfiling();
844+
845+
_ASSERTE(SUCCEEDED(hr));
846+
IfFailGo(hr);
847+
#endif // PROFILING_SUPPORTED
848+
840849
// This isn't done as part of InitializeGarbageCollector() above because
841850
// debugger must be initialized before creating EE thread objects
842851
FinalizerThread::FinalizerThreadCreate();
@@ -867,14 +876,6 @@ void EEStartupHelper()
867876

868877
IfFailGo(hr);
869878

870-
#ifdef PROFILING_SUPPORTED
871-
// Initialize the profiling services.
872-
hr = ProfilingAPIUtility::InitializeProfiling();
873-
874-
_ASSERTE(SUCCEEDED(hr));
875-
IfFailGo(hr);
876-
#endif // PROFILING_SUPPORTED
877-
878879
InitializeExceptionHandling();
879880

880881
//

0 commit comments

Comments
 (0)