如何enumerate线程# Java - 爪哇娇娃a*a2003-02-24 08:021 楼我在程序里生成了许多thread,但并没有保留他们的reference.有没有什么方法能够enumerate这些threads? 多谢。
z*g2003-02-24 08:022 楼Create a class YourThread extends Threadadd a static counter in it and increase by one in the constructor.【在 a***a 的大作中提到】: 我在程序里生成了许多thread,但并没有保留他们的reference.: 有没有什么方法能够enumerate这些threads? 多谢。
xt2003-02-24 08:023 楼I don't see how that helps. Best idea is to keep your references.【在 z****g 的大作中提到】: Create a class YourThread extends Thread: add a static counter in it and increase by one in the constructor.
z*g2003-02-24 08:024 楼Maybe I misunderstand his question. :(【在 xt 的大作中提到】: : I don't see how that helps. Best idea is to keep your references.
j*i2003-02-24 08:025 楼The ThreadGroup class might help. Just a thought. :-)【在 a***a 的大作中提到】: 我在程序里生成了许多thread,但并没有保留他们的reference.: 有没有什么方法能够enumerate这些threads? 多谢。