< prev index next >

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

Print this page
@@ -56,12 +56,12 @@
  {
      private final FileDescriptor fd;
  
      private final int fdVal;
  
-     /* IDs of native thread doing accept, for signalling */
-     private volatile long thread;
+     /* thread doing accept, for signalling */
+     private volatile Thread 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();
          }
      }
  

@@ -220,11 +220,11 @@
  
              try {
                  begin();
                  if (!isOpen())
                      return null;
-                 thread = NativeThread.current();
+                 thread = NativeThread.threadToSignal();
                  for (;;) {
                      n = Net.accept(fd, newfd, isaa);
                      if ((n == IOStatus.INTERRUPTED) && isOpen())
                          continue;
                      break;

@@ -251,11 +251,11 @@
      @Override
      public void implCloseSelectableChannel() throws IOException {
          synchronized (stateLock) {
              if (state != ChannelState.KILLED)
                  SctpNet.preClose(fdVal);
-             if (thread != 0)
+             if (thread != null)
                  NativeThread.signal(thread);
              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 >