8336339: (se) SelectionKey.interestOps(int) should not throw ClosedSelectorException

Reviewed-by: jpai, bpb
This commit is contained in:
Alan Bateman 2024-07-23 05:13:49 +00:00
parent 22914e0774
commit 9f03f68755
8 changed files with 136 additions and 34 deletions

View file

@ -26,7 +26,6 @@
package sun.nio.ch;
import java.io.IOException;
import java.nio.channels.ClosedSelectorException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.spi.SelectorProvider;
@ -92,11 +91,6 @@ class EPollSelectorImpl extends SelectorImpl {
EPoll.ctl(epfd, EPOLL_CTL_ADD, eventfd.efd(), EPOLLIN);
}
private void ensureOpen() {
if (!isOpen())
throw new ClosedSelectorException();
}
@Override
protected int doSelect(Consumer<SelectionKey> action, long timeout)
throws IOException
@ -243,7 +237,6 @@ class EPollSelectorImpl extends SelectorImpl {
@Override
public void setEventOps(SelectionKeyImpl ski) {
ensureOpen();
synchronized (updateLock) {
updateKeys.addLast(ski);
}