Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4248898

Need Runnable.stop() now that Thread.stop() is deprecated

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.1
    • core-libs
    • generic
    • generic



      Name: vi73552 Date: 06/23/99


      Thread.stop() is now deprecated. The docs recommend notifying a thread to exit through some application specific mechanism (e.g. setting a member variable).
      http://java.sun.com/products/jdk/1.2/docs/guide/misc/threadPrimitiveDeprecation.html

      If a Runnable.stop() method was added to the Runnable interface, then the implementor of the code running in the thread could set a member variable or do whatever it needs to do to safely exit the thread.

      Thread.stop and ThreadGroup.stop could be reimplemented to call Runnable.stop

      This makes it easier for an application hosting downloaded code which spawns threads. The application can force the code to run in a particular ThreadGroup and stop() the group to safely shut down all the hosted codes threads via Runnable.stop.

      Currently this isn't an issue for Applets since Applet.stop and Applet.destroy can be used (and the applet can safely shut down it's threads there). But for applications hosting code that does not derive from Applet, there is not a well defined way to safely tell that code to shut down all its threads.
      (Review ID: 84728)
      ======================================================================

            jjb Josh Bloch (Inactive)
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: