提交 f4edfb7c 编写于 作者: X xiaofeya

8202481: RegisterDuringSelect.java fails with...

8202481: RegisterDuringSelect.java fails with java.util.concurrent.ExecutionException: java.nio.channels.ClosedSelectorException
8207023: Add trace info to java/nio/channels/Selector/RegisterDuringSelect.java
Reviewed-by: alanb
上级 0d714ba8
......@@ -28,6 +28,7 @@
*/
import java.io.IOException;
import java.nio.channels.ClosedSelectorException;
import java.nio.channels.Pipe;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
......@@ -44,9 +45,14 @@ public class RegisterDuringSelect {
@Override
public Void call() throws IOException {
for (;;) {
sel.select();
try {
sel.select();
} catch (ClosedSelectorException ignore) {
return null;
}
if (sel.isOpen()) {
barrier.arriveAndAwaitAdvance();
System.out.println("selectLoop advanced ...");
} else {
// closed
return null;
......@@ -107,3 +113,4 @@ public class RegisterDuringSelect {
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册