From e76ec05aabc57886c6a832cbacf8a84fa88fee4c Mon Sep 17 00:00:00 2001 From: Doug Schaefer Date: Fri, 14 Oct 2016 11:28:27 -0400 Subject: [PATCH] Bug 503036 - Fix deadlock caused by previous fix. Change-Id: Ic333a7f0230e6a28033fd6659408895b34f5b70e --- .../eclipse/cdt/internal/core/model/BinaryRunner.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java index 56b08786ea7..b51513e6696 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryRunner.java @@ -86,7 +86,6 @@ public class BinaryRunner { private final Job runnerJob; // final fields don't need synchronization private IOutputEntry[] entries = new IOutputEntry[0]; private boolean isStopped= false; // access to isStopped must be synchronized. - private final static Object BINARY_RUNNER_FAMILY = new Object(); public BinaryRunner(IProject prj) { cproject = CModelManager.getDefault().create(prj); @@ -136,11 +135,6 @@ public class BinaryRunner { } return status; } - - @Override - public boolean belongsTo(Object family) { - return family == BINARY_RUNNER_FAMILY; - } }; job.setPriority(Job.LONG); return job; @@ -159,7 +153,9 @@ public class BinaryRunner { */ public void waitIfRunning() { try { - Job.getJobManager().join(BINARY_RUNNER_FAMILY, null); + if (runnerJob != null && !runnerJob.equals(Job.getJobManager().currentJob())) { + runnerJob.join(); + } } catch (InterruptedException e) { } }