Correctly set wakeup.compareAndSet(..) before wakeup the Selector. See #578

This commit is contained in:
Norman Maurer 2012-08-31 00:36:12 +02:00
parent e18959f836
commit 883af62c92

View File

@ -398,11 +398,14 @@ abstract class AbstractNioWorker implements Worker {
assert added; assert added;
if (added) { if (added) {
// wake up the selector to speed things if (wakenUp.compareAndSet(false, true)) {
Selector selector = this.selector; // wake up the selector to speed things
if (selector != null) { Selector selector = this.selector;
selector.wakeup(); if (selector != null) {
selector.wakeup();
}
} }
} }
} }