< prev index next >
src/java.base/unix/classes/sun/nio/ch/PollSelectorImpl.java
Print this page
@@ -38,11 +38,11 @@
/**
* Selector implementation based on poll
*/
-class PollSelectorImpl extends SelectorImpl {
+public class PollSelectorImpl extends SelectorImpl {
// initial capacity of poll array
private static final int INITIAL_CAPACITY = 16;
// poll array, grows as needed
@@ -63,11 +63,11 @@
// interrupt triggering and clearing
private final Object interruptLock = new Object();
private boolean interruptTriggered;
- PollSelectorImpl(SelectorProvider sp) throws IOException {
+ protected PollSelectorImpl(SelectorProvider sp) throws IOException {
super(sp);
int size = pollArrayCapacity * SIZE_POLLFD;
this.pollArray = new AllocatedNativeObject(size, false);
@@ -126,10 +126,14 @@
processDeregisterQueue();
return updateSelectedKeys();
}
+ protected int poll(long pollAddress, int numfds, int timeout) {
+ return poll0(pollAddress, numfds, timeout);
+ }
+
/**
* Process changes to the interest ops.
*/
private void processUpdateQueue() {
assert Thread.holdsLock(this);
@@ -381,11 +385,11 @@
private int getReventOps(int i) {
int offset = SIZE_POLLFD * i + REVENT_OFFSET;
return pollArray.getShort(offset);
}
- private static native int poll(long pollAddress, int numfds, int timeout);
+ private static native int poll0(long pollAddress, int numfds, int timeout);
static {
IOUtil.load();
}
}
< prev index next >