home *** CD-ROM | disk | FTP | other *** search
- package com.commerceone.util.thread;
-
- import com.commerceone.util.debug.Debug;
-
- public class ThreadDump {
- public static void main(String[] argv) {
- out();
- ThreadGroup tg = new ThreadGroup("Hippie");
- tg.setMaxPriority(7);
- Thread t1 = new 1(tg, "Bosse");
- t1.setPriority(6);
- t1.start();
- }
-
- public static synchronized void out() {
- Thread self = Thread.currentThread();
- int count = Thread.activeCount();
- Thread[] threads = new Thread[count * 2];
- int a_count = Thread.enumerate(threads);
- Debug dbg = Debug.getDefaultInstance();
- dbg.debug("");
- dbg.debug("Current " + self);
- dbg.debug("Active Count=" + count + ", Actual Count=" + a_count);
-
- for(int i = 0; i < a_count; ++i) {
- Thread t = threads[i];
- dbg.debug(t + " alive?=" + t.isAlive() + " daemon?=" + t.isDaemon() + " intptd?=" + t.isInterrupted());
- }
-
- }
- }
-