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?
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?
- relates to
-
JDK-4159054 sun.awt.AppContext needs a dispose()
- Closed
-
JDK-4189292 (thread spec) ThreadGroup and Thread need better and tighter specs
- Closed
-
JDK-4082405 (thread) Thread.enumerate() yields wrong result (it counts inactive threads)
- Closed