Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java
index f57a4829a..bcf912978 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Phase.java
@@ -44,6 +44,7 @@ public abstract class Phase {
private Map<Touchpoint, Map<String, Object>> touchpointToTouchpointPhaseParameters = new HashMap<Touchpoint, Map<String, Object>>();
private Map<Touchpoint, Map<String, Object>> touchpointToTouchpointOperandParameters = new HashMap<Touchpoint, Map<String, Object>>();
ActionManager actionManager; // injected from phaseset
+ protected boolean isPaused = false;
protected Phase(String phaseId, int weight, boolean forced) {
if (phaseId == null || phaseId.length() == 0)
@@ -121,6 +122,16 @@ public abstract class Phase {
subMonitor.setWorkRemaining(operands.length - i);
if (subMonitor.isCanceled())
throw new OperationCanceledException();
+ while (isPaused) {
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ mergeStatus(status, new Status(IStatus.ERROR, EngineActivator.ID, NLS.bind(Messages.phase_thread_interrupted_error, phaseId), e));
+ return;
+ }
+ if (subMonitor.isCanceled())
+ throw new OperationCanceledException();
+ }
Operand operand = operands[i];
if (!isApplicable(operand))
continue;
@@ -336,4 +347,8 @@ public abstract class Phase {
protected String getProblemMessage() {
return NLS.bind(Messages.phase_error, getClass().getName());
}
+
+ protected void setPaused(boolean isPaused) {
+ this.isPaused = isPaused;
+ }
}

Back to the top