Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2013-08-16 21:38:02 +0000
committerJoakim Erdfelt2013-08-16 21:38:02 +0000
commitd351c82de87037a6fb5f10b9c08d55b9fe3ae62a (patch)
tree22aca547bded61b7224306714606714e4a4ff7bd /jetty-io
parent26faa5f0d731682ea18c8a70dcec8246299a9512 (diff)
downloadorg.eclipse.jetty.project-d351c82de87037a6fb5f10b9c08d55b9fe3ae62a.tar.gz
org.eclipse.jetty.project-d351c82de87037a6fb5f10b9c08d55b9fe3ae62a.tar.xz
org.eclipse.jetty.project-d351c82de87037a6fb5f10b9c08d55b9fe3ae62a.zip
Revert "415062 SelectorManager wakeup optimisation"
Diffstat (limited to 'jetty-io')
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java
index 8645e5edc5..6db2e74453 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java
@@ -366,11 +366,12 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa
if (_thread==Thread.currentThread())
{
// If we are already iterating over the changes, just add this change to the list.
- if (_state.get()==SelectorState.CHANGING)
+ // No race here because it is this thread that is iterating over the changes.
+ if (_state.compareAndSet(SelectorState.CHANGING,SelectorState.MORE_CHANGES))
_changes.offer(change);
else
{
- // Otherwise we run the queued changes, list should mostly be empty
+ // Otherwise we run the queued changes
runChanges();
// and then directly run the passed change
runChange(change);

Back to the top