@@ -2721,7 +2721,7 @@ void Thread::CooperativeCleanup()
27212721
27222722 if (GCHeapUtilities::IsGCHeapInitialized ())
27232723 {
2724- gc_alloc_context* gc_alloc_context = &t_runtime_thread_locals.alloc_context .m_GCAllocContext ;
2724+ gc_alloc_context* gc_alloc_context = &t_runtime_thread_locals.alloc_context .m_GCAllocContext ;
27252725 // If the GC heap is initialized, we need to fix the alloc context for this detaching thread.
27262726 // GetTotalAllocatedBytes reads dead_threads_non_alloc_bytes, but will suspend EE, being in COOP mode we cannot race with that
27272727 // however, there could be other threads terminating and doing the same Add.
@@ -7264,13 +7264,10 @@ static void ManagedThreadBase_DispatchOuter(ManagedThreadCallState *pCallState)
72647264 PAL_ENDTRY;
72657265}
72667266
7267-
7268- // For the implementation, there are three variants of work possible:
7269-
7270- // 1. Establish the base of a managed thread, and switch to the correct AppDomain.
7271- static void ManagedThreadBase_FullTransition (ADCallBackFcnType pTarget,
7272- LPVOID args,
7273- UnhandledExceptionLocation filterType)
7267+ // Establish the base of a managed thread
7268+ static void ManagedThreadBase_Dispatch (ADCallBackFcnType pTarget,
7269+ LPVOID args,
7270+ UnhandledExceptionLocation filterType)
72747271{
72757272 CONTRACTL
72767273 {
@@ -7284,47 +7281,20 @@ static void ManagedThreadBase_FullTransition(ADCallBackFcnType pTarget,
72847281 ManagedThreadBase_DispatchOuter (&CallState);
72857282}
72867283
7287- // 2. Establish the base of a managed thread, but the AppDomain transition must be
7288- // deferred until later.
7289- void ManagedThreadBase_NoADTransition (ADCallBackFcnType pTarget,
7290- UnhandledExceptionLocation filterType)
7291- {
7292- CONTRACTL
7293- {
7294- GC_TRIGGERS;
7295- THROWS;
7296- MODE_COOPERATIVE;
7297- }
7298- CONTRACTL_END;
7299-
7300- AppDomain *pAppDomain = GetAppDomain ();
7301-
7302- ManagedThreadCallState CallState (pTarget, NULL , filterType);
7303-
7304- // self-describing, to create a pTurnAround data for eventual delivery to a subsequent AppDomain
7305- // transition.
7306- CallState.args = &CallState;
7307-
7308- ManagedThreadBase_DispatchOuter (&CallState);
7309- }
7310-
7311-
7312-
73137284// And here are the various exposed entrypoints for base thread behavior
73147285
73157286// The 'new Thread(...).Start()' case from COMSynchronizable kickoff thread worker
73167287void ManagedThreadBase::KickOff (ADCallBackFcnType pTarget, LPVOID args)
73177288{
73187289 WRAPPER_NO_CONTRACT;
7319- ManagedThreadBase_FullTransition (pTarget, args, ManagedThread);
7290+ ManagedThreadBase_Dispatch (pTarget, args, ManagedThread);
73207291}
73217292
7322- // The Finalizer thread establishes exception handling at its base, but defers all the AppDomain
7323- // transitions.
7293+ // The Finalizer thread establishes exception handling at its base
73247294void ManagedThreadBase::FinalizerBase (ADCallBackFcnType pTarget)
73257295{
73267296 WRAPPER_NO_CONTRACT;
7327- ManagedThreadBase_NoADTransition (pTarget, FinalizerThread);
7297+ ManagedThreadBase_Dispatch (pTarget, NULL , FinalizerThread);
73287298}
73297299
73307300// +----------------------------------------------------------------------------
0 commit comments