6645197: (so) Timed read with socket adaptor throws ClosedSelectorException if temporary selector GC'ed
Temporary selector for timeout is not protected from possilbe GC when used first time Reviewed-by: alanb
This commit is contained in:
parent
827decba87
commit
84b91226e3
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user