< prev index next >

src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java

Print this page
@@ -57,11 +57,11 @@
      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

@@ -198,11 +198,11 @@
          }
      }
  
      private void acceptCleanup() throws IOException {
          synchronized (stateLock) {
-             thread = 0;
+             thread = null;
              if (state == ChannelState.KILLPENDING)
                  kill();
          }
      }
  

@@ -251,12 +251,12 @@
      @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();
          }
      }
  

@@ -271,11 +271,11 @@
                  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 >