Fix race-condition which could lead to a NPE while register a Channel with a Worker. See #469
This commit is contained in:
parent
7f0f687965
commit
c059d13108
@ -143,7 +143,14 @@ abstract class AbstractNioWorker implements Worker {
|
||||
assert offered;
|
||||
|
||||
if (wakenUp.compareAndSet(false, true)) {
|
||||
selector.wakeup();
|
||||
// wake up the selector to speed things
|
||||
selector = this.selector;
|
||||
|
||||
// Check if the selector is not null to prevent NPE if selector was
|
||||
// set to null from another thread. See #469
|
||||
if (selector != null) {
|
||||
selector.wakeup();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user