提交 4594b728 编写于 作者: S sherman

6645197: (so) Timed read with socket adaptor throws ClosedSelectorException if...

6645197: (so) Timed read with socket adaptor throws ClosedSelectorException if temporary selector GC'ed
Summary: Temporary selector for timeout is not protected from possilbe GC when used first time
Reviewed-by: alanb
上级 09296ee2
...@@ -142,11 +142,10 @@ class Util { ...@@ -142,11 +142,10 @@ class Util {
|| ((sel = selWrapper.get()) == null) || ((sel = selWrapper.get()) == null)
|| (sel.provider() != sc.provider())) { || (sel.provider() != sc.provider())) {
sel = sc.provider().openSelector(); sel = sc.provider().openSelector();
localSelector.set(new SoftReference<SelectorWrapper>( selWrapper = new SelectorWrapper(sel);
new SelectorWrapper(sel))); localSelector.set(new SoftReference<SelectorWrapper>(selWrapper));
} else {
localSelectorWrapper.set(selWrapper);
} }
localSelectorWrapper.set(selWrapper);
return sel; return sel;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册