jdk/src/share/classes/java/lang/Thread.java
changeset 18776 c17100862d86
parent 18550 6d0f51c99930
child 20831 96cf18811858
equal deleted inserted replaced
18775:fa61a37ed42b 18776:c17100862d86
   863      * #join(long, int)}, {@link #sleep(long)}, or {@link #sleep(long, int)},
   863      * #join(long, int)}, {@link #sleep(long)}, or {@link #sleep(long, int)},
   864      * methods of this class, then its interrupt status will be cleared and it
   864      * methods of this class, then its interrupt status will be cleared and it
   865      * will receive an {@link InterruptedException}.
   865      * will receive an {@link InterruptedException}.
   866      *
   866      *
   867      * <p> If this thread is blocked in an I/O operation upon an {@link
   867      * <p> If this thread is blocked in an I/O operation upon an {@link
   868      * java.nio.channels.InterruptibleChannel </code>interruptible
   868      * java.nio.channels.InterruptibleChannel InterruptibleChannel}
   869      * channel<code>} then the channel will be closed, the thread's interrupt
   869      * then the channel will be closed, the thread's interrupt
   870      * status will be set, and the thread will receive a {@link
   870      * status will be set, and the thread will receive a {@link
   871      * java.nio.channels.ClosedByInterruptException}.
   871      * java.nio.channels.ClosedByInterruptException}.
   872      *
   872      *
   873      * <p> If this thread is blocked in a {@link java.nio.channels.Selector}
   873      * <p> If this thread is blocked in a {@link java.nio.channels.Selector}
   874      * then the thread's interrupt status will be set and it will return
   874      * then the thread's interrupt status will be set and it will return
  1881      * Returns the default handler invoked when a thread abruptly terminates
  1881      * Returns the default handler invoked when a thread abruptly terminates
  1882      * due to an uncaught exception. If the returned value is <tt>null</tt>,
  1882      * due to an uncaught exception. If the returned value is <tt>null</tt>,
  1883      * there is no default.
  1883      * there is no default.
  1884      * @since 1.5
  1884      * @since 1.5
  1885      * @see #setDefaultUncaughtExceptionHandler
  1885      * @see #setDefaultUncaughtExceptionHandler
       
  1886      * @return the default uncaught exception handler for all threads
  1886      */
  1887      */
  1887     public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler(){
  1888     public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler(){
  1888         return defaultUncaughtExceptionHandler;
  1889         return defaultUncaughtExceptionHandler;
  1889     }
  1890     }
  1890 
  1891 
  1893      * due to an uncaught exception. If this thread has not had an
  1894      * due to an uncaught exception. If this thread has not had an
  1894      * uncaught exception handler explicitly set then this thread's
  1895      * uncaught exception handler explicitly set then this thread's
  1895      * <tt>ThreadGroup</tt> object is returned, unless this thread
  1896      * <tt>ThreadGroup</tt> object is returned, unless this thread
  1896      * has terminated, in which case <tt>null</tt> is returned.
  1897      * has terminated, in which case <tt>null</tt> is returned.
  1897      * @since 1.5
  1898      * @since 1.5
       
  1899      * @return the uncaught exception handler for this thread
  1898      */
  1900      */
  1899     public UncaughtExceptionHandler getUncaughtExceptionHandler() {
  1901     public UncaughtExceptionHandler getUncaughtExceptionHandler() {
  1900         return uncaughtExceptionHandler != null ?
  1902         return uncaughtExceptionHandler != null ?
  1901             uncaughtExceptionHandler : group;
  1903             uncaughtExceptionHandler : group;
  1902     }
  1904     }