>>>>> "Patrick" == Patrick Doyle <[EMAIL PROTECTED]> writes:
Patrick> What's the easiest way to implement this? Does ThreadGroup
Patrick> provide enough functionality to do it? Or do I have to
Patrick> maintain a list of active threads myself? Does Classpath
Patrick> have any additional functionality to support this?
In libgcj we have a master thread which simply waits on a condition
variable. When a new thread is started, an active thread count is
incremented. When a thread dies, the count is decremented and the
master thread is notified. If it finds that the count is zero, the VM
shuts down. In our implementation ThreadGroup doesn't enter the
picture. The work is all done by Thread. You don't need a list of
all the active threads, just a count. Also, I'd advise reading the
JNI invocation API documentation before starting this.
Tom
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath