Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-10-31 05:30:41 -0500
committerEike Stepper2006-10-31 05:30:41 -0500
commitbdabfd099b427286ba1643241ea4649186880c4d (patch)
treef6d0979b127e54efd558bc5c8e5f28775b53ce6d /plugins/org.eclipse.net4j
parent8d2e9ab07ea993aaf72e98c999100ac671e6d80c (diff)
downloadcdo-bdabfd099b427286ba1643241ea4649186880c4d.tar.gz
cdo-bdabfd099b427286ba1643241ea4649186880c4d.tar.xz
cdo-bdabfd099b427286ba1643241ea4649186880c4d.zip
profiling TCPSelectorImpl.SELECT_TIMEOUT
Diffstat (limited to 'plugins/org.eclipse.net4j')
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPSelectorImpl.java1
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java6
2 files changed, 7 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPSelectorImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPSelectorImpl.java
index c96c59a385..037a9f1cf0 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPSelectorImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPSelectorImpl.java
@@ -200,6 +200,7 @@ public class TCPSelectorImpl extends AbstractLifecycle implements TCPSelector, R
@Override
protected void onDeactivate() throws Exception
{
+ selector.wakeup();
Exception exception = null;
try
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java
index 3ad736abd3..a12b92982f 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java
@@ -67,6 +67,11 @@ public final class TCPUtil
public static void setInterest(SelectionKey selectionKey, int operation, boolean interested)
{
+ if (selectionKey == null || !selectionKey.isValid())
+ {
+ return;
+ }
+
int newOps;
int oldOps = selectionKey.interestOps();
if (interested)
@@ -87,6 +92,7 @@ public final class TCPUtil
}
selectionKey.interestOps(newOps);
+ selectionKey.selector().wakeup();
}
}

Back to the top