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

(spec thread) ThreadGroup hierarchy destruction should be bottom up, not top down

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • generic
    • generic

      allan.jacobs@Eng 1998-06-12

      ThreadGroup destroy is specified so that the destruction of parent
      groups occurs before the recursive destruction of it's children.
      If one of the child groups throws an exception instead of dying
      quietly, then this child will be orphaned and will no longer be
      accessible via a ThreadGroup heirarchy. I think that the destruction
      should be bottom up to fix the problem.

      The actual implementation conforms to the current specification --
      destruction is not bottom up.

      The present wording:
      "This thread group is destroyed. If it has already been destroyed, or
      if any threads belong to it directly, then an IllegalThreadStateException
      is thrown. Otherwise, this method is called recursively for every thread
      group that belongs to this thread group, and this thread group is
      removed from its parent thread group."

      The wording should be:
      "Before a thread group is destroyed, this method is called recursively
      for every thread group that belongs to this thread group. If one of the
      children is not destroyed, this does not affect the attempts to destroy
      any of the other children. If any of the children throw an
      IllegalThreadStateException then this thread group will throw an
      IllegalThreadStateException.

      Otherwise, this thread group's children can be considered destroyed.
      If this thread group has already been destroyed, or if any threads belong
      to it directly, an IllegalThreadStateException is thrown.

      Finally, if a thread group's children are destroyed and no threads belong
      to it directly then the thread group is destroyed and removed from it's
      parent's thread group."

            psoper Pete Soper (Inactive)
            ajacobssunw Allan Jacobs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: