Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2013-08-16 13:12:24 +0000
committerGreg Wilkins2013-08-16 14:01:20 +0000
commitb58c05d77ccdee924cd9723cd307bab5e9135526 (patch)
tree2d9aa6612c84006c0f54d575e05a2e6b0206a647
parent70e7a69d196641465284e2617929f6cae0e1bb5e (diff)
downloadorg.eclipse.jetty.project-b58c05d77ccdee924cd9723cd307bab5e9135526.tar.gz
org.eclipse.jetty.project-b58c05d77ccdee924cd9723cd307bab5e9135526.tar.xz
org.eclipse.jetty.project-b58c05d77ccdee924cd9723cd307bab5e9135526.zip
415062 SelectorManager wakeup optimisation
Some further cleanup after sbordet review
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java5
1 files changed, 2 insertions, 3 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 6db2e74453..8645e5edc5 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,12 +366,11 @@ 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.
- // No race here because it is this thread that is iterating over the changes.
- if (_state.compareAndSet(SelectorState.CHANGING,SelectorState.MORE_CHANGES))
+ if (_state.get()==SelectorState.CHANGING)
_changes.offer(change);
else
{
- // Otherwise we run the queued changes
+ // Otherwise we run the queued changes, list should mostly be empty
runChanges();
// and then directly run the passed change
runChange(change);

Back to the top