src/java.base/share/classes/java/lang/Thread.java
changeset 50530 7e3aa681a484
parent 49925 3deb300f0e55
child 50719 106dc156ce6b
equal deleted inserted replaced
50529:efd199ab8322 50530:7e3aa681a484
   936         // The VM can handle all thread states
   936         // The VM can handle all thread states
   937         stop0(new ThreadDeath());
   937         stop0(new ThreadDeath());
   938     }
   938     }
   939 
   939 
   940     /**
   940     /**
   941      * Throws {@code UnsupportedOperationException}.
       
   942      *
       
   943      * @param obj ignored
       
   944      *
       
   945      * @deprecated This method was originally designed to force a thread to stop
       
   946      *        and throw a given {@code Throwable} as an exception. It was
       
   947      *        inherently unsafe (see {@link #stop()} for details), and furthermore
       
   948      *        could be used to generate exceptions that the target thread was
       
   949      *        not prepared to handle.
       
   950      *        For more information, see
       
   951      *        <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">Why
       
   952      *        are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
       
   953      *        This method is subject to removal in a future version of Java SE.
       
   954      */
       
   955     @Deprecated(since="1.2", forRemoval=true)
       
   956     public final synchronized void stop(Throwable obj) {
       
   957         throw new UnsupportedOperationException();
       
   958     }
       
   959 
       
   960     /**
       
   961      * Interrupts this thread.
   941      * Interrupts this thread.
   962      *
   942      *
   963      * <p> Unless the current thread is interrupting itself, which is
   943      * <p> Unless the current thread is interrupting itself, which is
   964      * always permitted, the {@link #checkAccess() checkAccess} method
   944      * always permitted, the {@link #checkAccess() checkAccess} method
   965      * of this thread is invoked, which may cause a {@link
   945      * of this thread is invoked, which may cause a {@link
  1058      * is reset or not based on the value of ClearInterrupted that is
  1038      * is reset or not based on the value of ClearInterrupted that is
  1059      * passed.
  1039      * passed.
  1060      */
  1040      */
  1061     @HotSpotIntrinsicCandidate
  1041     @HotSpotIntrinsicCandidate
  1062     private native boolean isInterrupted(boolean ClearInterrupted);
  1042     private native boolean isInterrupted(boolean ClearInterrupted);
  1063 
       
  1064     /**
       
  1065      * Throws {@link NoSuchMethodError}.
       
  1066      *
       
  1067      * @deprecated This method was originally designed to destroy this
       
  1068      *     thread without any cleanup. Any monitors it held would have
       
  1069      *     remained locked. However, the method was never implemented.
       
  1070      *     If it were to be implemented, it would be deadlock-prone in
       
  1071      *     much the manner of {@link #suspend}. If the target thread held
       
  1072      *     a lock protecting a critical system resource when it was
       
  1073      *     destroyed, no thread could ever access this resource again.
       
  1074      *     If another thread ever attempted to lock this resource, deadlock
       
  1075      *     would result. Such deadlocks typically manifest themselves as
       
  1076      *     "frozen" processes. For more information, see
       
  1077      *     <a href="{@docRoot}/java.base/java/lang/doc-files/threadPrimitiveDeprecation.html">
       
  1078      *     Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?</a>.
       
  1079      *     This method is subject to removal in a future version of Java SE.
       
  1080      * @throws NoSuchMethodError always
       
  1081      */
       
  1082     @Deprecated(since="1.5", forRemoval=true)
       
  1083     public void destroy() {
       
  1084         throw new NoSuchMethodError();
       
  1085     }
       
  1086 
  1043 
  1087     /**
  1044     /**
  1088      * Tests if this thread is alive. A thread is alive if it has
  1045      * Tests if this thread is alive. A thread is alive if it has
  1089      * been started and has not yet died.
  1046      * been started and has not yet died.
  1090      *
  1047      *