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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • None
    • generic
    • generic

      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?

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: