summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-30 09:30:58 (EDT)
committerEike Stepper2007-07-30 09:30:58 (EDT)
commit2c8534135fb2aa9d72c424b12346b6f194405681 (patch)
treedafa1afec4ae1e50822488d6d40c9829db36fb09
parent2335a0d7383e6f7c8fe3359f600276a93ca38fef (diff)
downloadcdo-2c8534135fb2aa9d72c424b12346b6f194405681.zip
cdo-2c8534135fb2aa9d72c424b12346b6f194405681.tar.gz
cdo-2c8534135fb2aa9d72c424b12346b6f194405681.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MON.java6
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java12
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java1
3 files changed, 9 insertions, 10 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MON.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MON.java
index 86a26cf..7fddaf2 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MON.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MON.java
@@ -14,7 +14,6 @@ import org.eclipse.net4j.internal.util.bundle.OM;
import org.eclipse.net4j.util.om.monitor.IllegalMonitorNestingException;
import org.eclipse.net4j.util.om.monitor.MonitorAlreadyBegunException;
import org.eclipse.net4j.util.om.monitor.MonitorException;
-import org.eclipse.net4j.util.om.monitor.MonitorNotBegunException;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
/**
@@ -93,11 +92,6 @@ public final class MON
"Used monitor stack:\n" + monitor.dump());
}
- if (!current.hasBegun())
- {
- throw new MonitorNotBegunException("Monitor has not begun");
- }
-
monitor.checkCanceled();
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
index 4beca30..d5c6d98 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
@@ -3,6 +3,7 @@ package org.eclipse.net4j.internal.util.om.monitor;
import org.eclipse.net4j.internal.util.bundle.OM;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
import org.eclipse.net4j.util.om.monitor.MonitorCanceledException;
+import org.eclipse.net4j.util.om.monitor.MonitorNotBegunException;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.OMSubMonitor;
import org.eclipse.net4j.util.om.monitor.TotalWorkExceededException;
@@ -117,9 +118,8 @@ public abstract class Monitor implements OMMonitor, OMSubMonitor
finally
{
MON.checkMonitor(child);
- child.done();
-
MON.setMonitor(this);
+ child.done();
child = null;
}
@@ -160,11 +160,10 @@ public abstract class Monitor implements OMMonitor, OMSubMonitor
public void join(String msg) throws MonitorCanceledException
{
MON.checkMonitor(this);
- done();
-
MON.setMonitor(parent);
parent.setChild(null);
parent.message(msg);
+ done();
}
public void join() throws MonitorCanceledException
@@ -254,6 +253,11 @@ public abstract class Monitor implements OMMonitor, OMSubMonitor
protected void checkWork(int work)
{
+ if (!hasBegun())
+ {
+ throw new MonitorNotBegunException("Monitor has not begun");
+ }
+
if (totalWork != UNKNOWN && this.work + work > totalWork)
{
throw new TotalWorkExceededException(("Work of " + work + " exceeded total work of " + totalWork));
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
index 19024b2..9aa3bb5 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
@@ -79,6 +79,7 @@ public class NullMonitor implements OMMonitor, OMSubMonitor
public void setTask(String task)
{
+ // System.out.println("NullMonitor: " + task);
}
public void worked()