From cb796ac08c6b5e49ad171a455226a0a03b0976ed Mon Sep 17 00:00:00 2001 From: Lluis Sanchez Date: Mon, 18 Sep 2017 15:23:48 +0200 Subject: Fix parallel builds Also added unit test --- .../MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild') diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs index b024f9b48e..2c28218fa8 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteBuildEngineManager.cs @@ -172,21 +172,21 @@ namespace MonoDevelop.Projects.MSBuild // Find builders which are not being shut down - var candiateBuilders = builders.GetBuilders (builderKey).Where (b => !b.IsShuttingDown); + var candiateBuilders = builders.GetBuilders (builderKey).Where (b => !b.IsShuttingDown && (!b.IsBusy || allowBusy)); if (buildSessionId != null) { - // Look for a builder that already started the session, no matter if the builder is busy or not. + // Look for a builder that already started the session. // If there isn't one, pick builders which don't have any session assigned, so a new one // can be started. var sessionBuilders = candiateBuilders.Where (b => b.BuildSessionId == buildSessionId); if (!sessionBuilders.Any ()) - sessionBuilders = candiateBuilders.Where (b => b.BuildSessionId == null && (!b.IsBusy || allowBusy)); + sessionBuilders = candiateBuilders.Where (b => b.BuildSessionId == null); candiateBuilders = sessionBuilders; } else // Pick builders which are not bound to any session - candiateBuilders = candiateBuilders.Where (b => b.BuildSessionId == null && (!b.IsBusy || allowBusy)); + candiateBuilders = candiateBuilders.Where (b => b.BuildSessionId == null); // Prefer non-busy builders -- cgit v1.2.3