< prev index next >
src/java.base/unix/classes/sun/nio/ch/PollSelectorImpl.java
Print this page
*** 38,48 ****
/**
* Selector implementation based on poll
*/
! class PollSelectorImpl extends SelectorImpl {
// initial capacity of poll array
private static final int INITIAL_CAPACITY = 16;
// poll array, grows as needed
--- 38,48 ----
/**
* Selector implementation based on poll
*/
! public class PollSelectorImpl extends SelectorImpl {
// initial capacity of poll array
private static final int INITIAL_CAPACITY = 16;
// poll array, grows as needed
*** 63,73 ****
// interrupt triggering and clearing
private final Object interruptLock = new Object();
private boolean interruptTriggered;
! PollSelectorImpl(SelectorProvider sp) throws IOException {
super(sp);
int size = pollArrayCapacity * SIZE_POLLFD;
this.pollArray = new AllocatedNativeObject(size, false);
--- 63,73 ----
// interrupt triggering and clearing
private final Object interruptLock = new Object();
private boolean interruptTriggered;
! protected PollSelectorImpl(SelectorProvider sp) throws IOException {
super(sp);
int size = pollArrayCapacity * SIZE_POLLFD;
this.pollArray = new AllocatedNativeObject(size, false);
*** 126,135 ****
--- 126,139 ----
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,391 ****
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);
static {
IOUtil.load();
}
}
--- 385,395 ----
private int getReventOps(int i) {
int offset = SIZE_POLLFD * i + REVENT_OFFSET;
return pollArray.getShort(offset);
}
! private static native int poll0(long pollAddress, int numfds, int timeout);
static {
IOUtil.load();
}
}
< prev index next >