SpinLockHolder holder(&m_lock);
m_domainId = appDomainId;
m_callCountOptimizationThreshhold = g_pConfig->TieredCompilation_Tier1CallCountThreshold();
- m_asyncWorkDoneEvent.CreateManualEventNoThrow(TRUE);
}
void TieredCompilationManager::InitiateTier1CountingDelay()
return;
}
-// static
-// called from EEShutDownHelper
-void TieredCompilationManager::ShutdownAllDomains()
+void TieredCompilationManager::Shutdown()
{
STANDARD_VM_CONTRACT;
- AppDomainIterator domain(TRUE);
- while (domain.Next())
- {
- AppDomain * pDomain = domain.GetDomain();
- if (pDomain != NULL)
- {
- pDomain->GetTieredCompilationManager()->Shutdown(TRUE);
- }
- }
-}
-
-void TieredCompilationManager::Shutdown(BOOL fBlockUntilAsyncWorkIsComplete)
-{
- STANDARD_VM_CONTRACT;
-
- {
- SpinLockHolder holder(&m_lock);
- m_isAppDomainShuttingDown = TRUE;
- }
- if (fBlockUntilAsyncWorkIsComplete)
- {
- m_asyncWorkDoneEvent.Wait(INFINITE, FALSE);
- }
+ SpinLockHolder holder(&m_lock);
+ m_isAppDomainShuttingDown = TRUE;
}
VOID WINAPI TieredCompilationManager::Tier1DelayTimerCallback(PVOID parameter, BOOLEAN timerFired)
//m_lock should be held
m_countOptimizationThreadsRunning++;
- m_asyncWorkDoneEvent.Reset();
}
void TieredCompilationManager::DecrementWorkerThreadCount()
//m_lock should be held
m_countOptimizationThreadsRunning--;
- if (m_countOptimizationThreadsRunning == 0)
- {
- m_asyncWorkDoneEvent.Set();
- }
}
//static
string musicStoreSrcDirectory = GetMusicStoreSrcDirectory(outputDir);
string tfm = DotNetSetup.GetTargetFrameworkMonikerForFrameworkVersion(dotNetInstall.FrameworkVersion);
ExePath = "MusicStore.dll";
- WorkingDirPath = GetMusicStorePublishDirectory(outputDir, tfm);
+ WorkingDirPath = GetMusicStorePublishDirectory(dotNetInstall, outputDir, tfm);
EnvironmentVariables.Add("DOTNET_SHARED_STORE", GetMusicStoreStoreDir(outputDir));
}
private static async Task<string> Publish(DotNetInstallation dotNetInstall, string outputDir, ITestOutputHelper output)
{
string tfm = DotNetSetup.GetTargetFrameworkMonikerForFrameworkVersion(dotNetInstall.FrameworkVersion);
- string publishDir = GetMusicStorePublishDirectory(outputDir, tfm);
+ string publishDir = GetMusicStorePublishDirectory(dotNetInstall, outputDir, tfm);
string manifestPath = Path.Combine(GetMusicStoreStoreDir(outputDir), dotNetInstall.Architecture, tfm, "artifact.xml");
- FileTasks.DeleteDirectory(publishDir, output);
+ if (publishDir != null)
+ {
+ FileTasks.DeleteDirectory(publishDir, output);
+ }
string dotNetExePath = dotNetInstall.DotNetExe;
await new ProcessRunner(dotNetExePath, $"publish -c Release -f {tfm} --manifest {manifestPath}")
.WithWorkingDirectory(GetMusicStoreSrcDirectory(outputDir))
.WithEnvironmentVariable("UseSharedCompilation", "false")
.WithLog(output)
.Run();
+
+ publishDir = GetMusicStorePublishDirectory(dotNetInstall, outputDir, tfm);
+ if (publishDir == null)
+ {
+ throw new DirectoryNotFoundException("Could not find 'publish' directory");
+ }
return publishDir;
}
return Path.Combine(GetJitBenchRepoRootDir(outputDir), "src", "MusicStore");
}
- static string GetMusicStorePublishDirectory(string outputDir, string tfm)
+ static string GetMusicStorePublishDirectory(DotNetInstallation dotNetInstall, string outputDir, string tfm)
{
- return Path.Combine(GetMusicStoreSrcDirectory(outputDir), "bin", "Release", tfm, "publish");
+ string dir = Path.Combine(GetMusicStoreSrcDirectory(outputDir), "bin", dotNetInstall.Architecture, "Release", tfm, "publish");
+ if (Directory.Exists(dir))
+ {
+ return dir;
+ }
+
+ dir = Path.Combine(GetMusicStoreSrcDirectory(outputDir), "bin", "Release", tfm, "publish");
+ if (Directory.Exists(dir))
+ {
+ return dir;
+ }
+
+ return null;
}
static string GetMusicStoreStoreDir(string outputDir)