Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/classes/java/lang/Thread.java
          +++ new/src/share/classes/java/lang/Thread.java
↓ open down ↓ 221 lines elided ↑ open up ↑
 222  222       * Set by (private) java.util.concurrent.locks.LockSupport.setBlocker
 223  223       * Accessed using java.util.concurrent.locks.LockSupport.getBlocker
 224  224       */
 225  225      volatile Object parkBlocker;
 226  226  
 227  227      /* The object in which this thread is blocked in an interruptible I/O
 228  228       * operation, if any.  The blocker's interrupt method should be invoked
 229  229       * after setting this thread's interrupt status.
 230  230       */
 231  231      private volatile Interruptible blocker;
 232      -    private Object blockerLock = new Object();
      232 +    private final Object blockerLock = new Object();
 233  233  
 234  234      /* Set the blocker field; invoked via sun.misc.SharedSecrets from java.nio code
 235  235       */
 236  236      void blockedOn(Interruptible b) {
 237  237          synchronized (blockerLock) {
 238  238              blocker = b;
 239  239          }
 240  240      }
 241  241  
 242  242      /**
↓ open down ↓ 438 lines elided ↑ open up ↑
 681  681           * This method is not invoked for the main method thread or "system"
 682  682           * group threads created/set up by the VM. Any new functionality added
 683  683           * to this method in the future may have to also be added to the VM.
 684  684           *
 685  685           * A zero status value corresponds to state "NEW".
 686  686           */
 687  687          if (threadStatus != 0)
 688  688              throw new IllegalThreadStateException();
 689  689  
 690  690          /* Notify the group that this thread is about to be started
 691      -         * so that it can be added to the group's list of threads. */
      691 +         * so that it can be added to the group's list of threads
      692 +         * and the group's unstarted count can be decremented. */
 692  693          group.threadStarting(this);
 693  694  
 694      -        boolean failed = true;
      695 +        boolean started = false;
 695  696          try {
 696  697              start0();
 697      -            failed = false;
      698 +            started = true;
 698  699          } finally {
 699  700              try {
 700      -                group.threadStarted(this, failed);
      701 +                if (!started) {
      702 +                    group.threadStartFailed(this);
      703 +                }
 701  704              } catch (Throwable ignore) {
 702  705                  /* do nothing. If start0 threw a Throwable then
 703  706                    it will be passed up the call stack */
 704  707              }
 705  708          }
 706  709  
 707  710          if (stopBeforeStart) {
 708  711              stop0(throwableFromStop);
 709  712          }
 710  713      }
↓ open down ↓ 1349 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX