pDomain->GetMulticoreJitManager().AutoStartProfile(pDomain);
#endif
- pDomain->m_pRootAssembly->ExecuteMainMethod(NULL);
+ pDomain->m_pRootAssembly->ExecuteMainMethod(NULL, FALSE /* waitForOtherThreads */);
}
pThread->ReturnToContext(&frame);
EE_TRY_FOR_FINALLY(Param *, pParam, ¶m)
{
- pParam->iRetVal = pParam->pAssembly->ExecuteMainMethod(pParam->pStringArgs);
+ pParam->iRetVal = pParam->pAssembly->ExecuteMainMethod(pParam->pStringArgs, TRUE /* waitForOtherThreads */);
}
EE_FINALLY
{
}
}
-INT32 Assembly::ExecuteMainMethod(PTRARRAYREF *stringArgs)
+INT32 Assembly::ExecuteMainMethod(PTRARRAYREF *stringArgs, BOOL waitForOtherThreads)
{
CONTRACTL
{
//to decide when the process should get torn down. So, don't call it from
// AppDomain.ExecuteAssembly()
if (pMeth) {
- if (stringArgs == NULL)
+ if (waitForOtherThreads)
RunMainPost();
}
else {
//****************************************************************************************
//
- INT32 ExecuteMainMethod(PTRARRAYREF *stringArgs);
+ INT32 ExecuteMainMethod(PTRARRAYREF *stringArgs, BOOL waitForOtherThreads);
//****************************************************************************************
arguments->SetAt(i, argument);
}
- DWORD retval = pAssembly->ExecuteMainMethod(&arguments);
+ DWORD retval = pAssembly->ExecuteMainMethod(&arguments, TRUE /* waitForOtherThreads */);
if (pReturnValue)
{
*pReturnValue = retval;
// since this is the thread 0 entry point for AppX apps we use
// the EntryPointFilter so that an unhandled exception here will
// trigger the same behavior as in classic apps.
- pParam->pRootAssembly->ExecuteMainMethod(NULL);
+ pParam->pRootAssembly->ExecuteMainMethod(NULL, FALSE /* waitForOtherThreads */);
}
PAL_EXCEPT_FILTER(EntryPointFilter)
{