From c0b88885b155c8f692e711a62903bf5de56fd6d7 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 20 Apr 2010 22:43:42 +0000 Subject: [PATCH] JETTY-1187 git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@1533 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../main/java/org/eclipse/jetty/io/nio/SelectorManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java index 1c30409a02b..0f63db77b97 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java @@ -104,6 +104,10 @@ public abstract class SelectorManager extends AbstractLifeCycle */ public void register(SocketChannel channel, Object att) { + // The ++ increment here is not atomic, but it does not matter. + // so long as the value changes sometimes, then connections will + // be distributed over the available sets. + int s=_set++; s=s%_selectSets; SelectSet[] sets=_selectSet;