< prev index next > src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java
Print this page
private static final int ST_CLOSING = 1;
private static final int ST_CLOSED = 2;
private int state;
// ID of native thread currently blocked in this channel, for signalling
- private long thread;
+ private NativeThread thread;
// Binding
private SocketAddress localAddress; // null => unbound
// set true when exclusive binding is on and SO_REUSEADDR is emulated
private void end(boolean blocking, boolean completed)
throws AsynchronousCloseException
{
if (blocking) {
synchronized (stateLock) {
- thread = 0;
+ thread = null;
if (state == ST_CLOSING) {
tryFinishClose();
}
}
end(completed);
* Closes the socket if there are no accept in progress and the channel is
* not registered with a Selector.
*/
private boolean tryClose() throws IOException {
assert Thread.holdsLock(stateLock) && state == ST_CLOSING;
- if ((thread == 0) && !isRegistered()) {
+ if ((thread == null) && !isRegistered()) {
state = ST_CLOSED;
nd.close(fd);
return true;
} else {
return false;
private void implCloseBlockingMode() throws IOException {
synchronized (stateLock) {
assert state < ST_CLOSING;
state = ST_CLOSING;
if (!tryClose()) {
- nd.preClose(fd, thread, 0);
+ nd.preClose(fd, thread, null);
}
}
}
/**
< prev index next >