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.provider() != sc.provider())) {
|
||||
sel = sc.provider().openSelector();
|
||||
localSelector.set(new SoftReference<SelectorWrapper>(
|
||||
new SelectorWrapper(sel)));
|
||||
} else {
|
||||
localSelectorWrapper.set(selWrapper);
|
||||
selWrapper = new SelectorWrapper(sel);
|
||||
localSelector.set(new SoftReference<SelectorWrapper>(selWrapper));
|
||||
}
|
||||
localSelectorWrapper.set(selWrapper);
|
||||
return sel;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user