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

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

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      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)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: