src/share/classes/java/lang/Thread.java

Print this page




 956      * @see     #interrupted()
 957      * @revised 6.0
 958      */
 959     public boolean isInterrupted() {
 960         return isInterrupted(false);
 961     }
 962 
 963     /**
 964      * Tests if some Thread has been interrupted.  The interrupted state
 965      * is reset or not based on the value of ClearInterrupted that is
 966      * passed.
 967      */
 968     private native boolean isInterrupted(boolean ClearInterrupted);
 969 
 970     /**
 971      * Throws {@link NoSuchMethodError}.
 972      *
 973      * @deprecated This method was originally designed to destroy this
 974      *     thread without any cleanup. Any monitors it held would have
 975      *     remained locked. However, the method was never implemented.
 976      *     If if were to be implemented, it would be deadlock-prone in
 977      *     much the manner of {@link #suspend}. If the target thread held
 978      *     a lock protecting a critical system resource when it was
 979      *     destroyed, no thread could ever access this resource again.
 980      *     If another thread ever attempted to lock this resource, deadlock
 981      *     would result. Such deadlocks typically manifest themselves as
 982      *     "frozen" processes. For more information, see
 983      *     <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">
 984      *     Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
 985      * @throws NoSuchMethodError always
 986      */
 987     @Deprecated
 988     public void destroy() {
 989         throw new NoSuchMethodError();
 990     }
 991 
 992     /**
 993      * Tests if this thread is alive. A thread is alive if it has
 994      * been started and has not yet died.
 995      *
 996      * @return  <code>true</code> if this thread is alive;




 956      * @see     #interrupted()
 957      * @revised 6.0
 958      */
 959     public boolean isInterrupted() {
 960         return isInterrupted(false);
 961     }
 962 
 963     /**
 964      * Tests if some Thread has been interrupted.  The interrupted state
 965      * is reset or not based on the value of ClearInterrupted that is
 966      * passed.
 967      */
 968     private native boolean isInterrupted(boolean ClearInterrupted);
 969 
 970     /**
 971      * Throws {@link NoSuchMethodError}.
 972      *
 973      * @deprecated This method was originally designed to destroy this
 974      *     thread without any cleanup. Any monitors it held would have
 975      *     remained locked. However, the method was never implemented.
 976      *     If it were to be implemented, it would be deadlock-prone in
 977      *     much the manner of {@link #suspend}. If the target thread held
 978      *     a lock protecting a critical system resource when it was
 979      *     destroyed, no thread could ever access this resource again.
 980      *     If another thread ever attempted to lock this resource, deadlock
 981      *     would result. Such deadlocks typically manifest themselves as
 982      *     "frozen" processes. For more information, see
 983      *     <a href="{@docRoot}/../technotes/guides/concurrency/threadPrimitiveDeprecation.html">
 984      *     Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
 985      * @throws NoSuchMethodError always
 986      */
 987     @Deprecated
 988     public void destroy() {
 989         throw new NoSuchMethodError();
 990     }
 991 
 992     /**
 993      * Tests if this thread is alive. A thread is alive if it has
 994      * been started and has not yet died.
 995      *
 996      * @return  <code>true</code> if this thread is alive;