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,12 +398,15 @@ abstract class AbstractNioWorker implements Worker {
assert added; assert added;
if (added) { if (added) {
if (wakenUp.compareAndSet(false, true)) {
// wake up the selector to speed things // wake up the selector to speed things
Selector selector = this.selector; Selector selector = this.selector;
if (selector != null) { if (selector != null) {
selector.wakeup(); selector.wakeup();
} }
} }
}
} }
} }