< prev index next > src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
Print this page
private final FileDescriptor fd;
private final int fdVal;
/* IDs of native thread doing accept, for signalling */
- private volatile long thread;
+ private volatile NativeThread thread;
/* Lock held by thread currently blocked in this channel */
private final Object lock = new Object();
/* Lock held by any thread that modifies the state fields declared below
}
}
private void acceptCleanup() throws IOException {
synchronized (stateLock) {
- thread = 0;
+ thread = null;
if (state == ChannelState.KILLPENDING)
kill();
}
}
@Override
public void implCloseSelectableChannel() throws IOException {
synchronized (stateLock) {
if (state != ChannelState.KILLED)
SctpNet.preClose(fdVal);
- if (thread != 0)
- NativeThread.signal(thread);
+ if (NativeThread.isNativeThread(thread))
+ thread.signal();
if (!isRegistered())
kill();
}
}
return;
}
assert !isOpen() && !isRegistered();
// Postpone the kill if there is a thread in accept
- if (thread == 0) {
+ if (thread == null) {
state = ChannelState.KILLED;
SctpNet.close(fdVal);
} else {
state = ChannelState.KILLPENDING;
}
< prev index next >