460210 - ExecutionStragegy producer for SelectManager calls onOpen from produce method

fixed NPE on connection destroy for stopped selector
This commit is contained in:
Greg Wilkins 2015-02-19 14:30:39 +11:00
parent e83549f4b4
commit c4a49110ef
1 changed files with 8 additions and 3 deletions

View File

@ -120,7 +120,8 @@ public class ManagedSelector extends AbstractLifeCycle implements Runnable, Dump
_actions.offer(change);
if (_selecting)
{
_selector.wakeup();
if (_selector!=null)
_selector.wakeup();
// To avoid the extra select wakeup.
_selecting=false;
}
@ -708,8 +709,12 @@ public class ManagedSelector extends AbstractLifeCycle implements Runnable, Dump
@Override
public void run()
{
Selector selector=_selector;
_selector=null;
Selector selector;
try(SpinLock.Lock lock = _lock.lock())
{
selector=_selector;
_selector=null;
}
closeNoExceptions(selector);
_latch.countDown();
}