summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2010-08-08 23:28:39 (EDT)
committerCaspar De Groot2010-08-08 23:28:39 (EDT)
commit59c91fbed63f9cbf097fe7ea8b02558e8a4b1787 (patch)
treef8d922c1f0670c3ffe56c187281bff0570865179
parentc547d0fd2cb943b8fdfccb5733feca92e3e4403c (diff)
downloadcdo-59c91fbed63f9cbf097fe7ea8b02558e8a4b1787.zip
cdo-59c91fbed63f9cbf097fe7ea8b02558e8a4b1787.tar.gz
cdo-59c91fbed63f9cbf097fe7ea8b02558e8a4b1787.tar.bz2
[322101] CDOServerProtocol can get deactivated while associated Signals are still executing
https://bugs.eclipse.org/bugs/show_bug.cgi?id=322101
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
index c78e8ca..2277c1c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
@@ -280,6 +280,21 @@ public class SignalProtocol<INFRA_STRUCTURE> extends Protocol<INFRA_STRUCTURE> i
}
@Override
+ protected void doBeforeDeactivate() throws Exception
+ {
+ synchronized (signals)
+ {
+ // Wait at most 10 seconds for running signals to finish
+ int waitMillis = 10 * 1000;
+ long stop = System.currentTimeMillis() + waitMillis;
+ while (!signals.isEmpty() && System.currentTimeMillis() < stop)
+ {
+ signals.wait(1000L);
+ }
+ }
+ }
+
+ @Override
protected void doDeactivate() throws Exception
{
for (Signal signal : getSignals())