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

(thread) ThreadGroup.activeCount() doesn't always reach 0 after stop() called

    Details

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

      Description

      I recently wrote sun.awt.AppContext.dispose() which, among other things, calls
      ThreadGroup.stop() and waits for ThreadGroup.activeCount() to return 0 before
      calling ThreadGroup.destroy().

      The problem is that ThreadGroup.activeCount() never goes down to 0 when
      appletviewer calls my sun.awt.AppContext.dispose() method. activeCount()
      returns 1, but ThreadGroup.enumerate() returns 0, so I can't even determine
      the offending Thread.

      In ThreadGroup.java, activeCount() returns nthreads, but enumerate() counts
      only those Threads for which isAlive() returns true. Shouldn't these work
      the same?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                psoper Pete Soper (Inactive)
                Reporter:
                feckssunw Fred Ecks (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: