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

(spec thread) Documentation for Thread.isAlive() should be more clear

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-libs
    • generic
    • generic



      Name: rmT116609 Date: 10/29/2001



      We are using Thread.isAlive() to determine whether a thread has exited its run() method
      and are not sure if this is an appropriate way to check this.

      Could you please add more information to the documentation explaining exactly
      what Thread.isAlive() == false tells us?

      ----------------------------------------------------------------------------
      Currently the documentation says:

      "Tests if this thread is alive. A thread is alive if it has been started and has not yet died"

      Specifically my concerns are:

      1) I assume, "A thread is alive if it has been started" means Thread.start()
      has been called? or does it mean its run method has started?

      2) "has not yet died" : Does this mean the object's run() method has exited? -
      or is there some cleaning up that the VM may be doing after the run method
      exits before isAlive() will return false?
      (Review ID: 134608)
      ======================================================================

            psoper Pete Soper (Inactive)
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: