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

(spec thread) Thread.setDaemon() should not be allowed after the thread terminates

XMLWordPrintable

    • b16
    • generic
    • generic
    • Not verified

        Name: boT120536 Date: 01/12/2001


        java version "1.3.0_01"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
        Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)

        The specification for Thread.setDaemon says:

        "This method must be called before the thread is started. "

        However the implementation uses isAlive() to determine whether or not the
        thread has been started. This means that when the thread has terminated isAlive
        () returns false and setDaemon is allowed to proceed *after* the thread has
        started. Obviously this has no practical consequences - except in pedantic
        compliance tests.

        This is very minor but should be fixed as part of the general thread tidy up
        alluded to in various bug evaluations. The simplest fix is probably to the
        specification.
        (Review ID: 115025)
        ======================================================================

              chegar Chris Hegarty
              bonealsunw Bret O'neal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: