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;
if (added) {
// wake up the selector to speed things
Selector selector = this.selector;
if (selector != null) {
selector.wakeup();
if (wakenUp.compareAndSet(false, true)) {
// wake up the selector to speed things
Selector selector = this.selector;
if (selector != null) {
selector.wakeup();
}
}
}
}