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 346a9b70c65..56b08786ea7 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,6 +86,7 @@ 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); @@ -135,6 +136,11 @@ public class BinaryRunner { } return status; } + + @Override + public boolean belongsTo(Object family) { + return family == BINARY_RUNNER_FAMILY; + } }; job.setPriority(Job.LONG); return job; @@ -153,10 +159,7 @@ public class BinaryRunner { */ public void waitIfRunning() { try { - Job currentJob = Job.getJobManager().currentJob(); - if (currentJob != null && !currentJob.equals(runnerJob)) { - runnerJob.join(); - } + Job.getJobManager().join(BINARY_RUNNER_FAMILY, null); } catch (InterruptedException e) { } }