[START MICROSOFT WEBMAIL SUPER INDENT] > code should never call Thread.stop() if you really need to > stop a thread .. this is code that might work > kicker.interrupt(); > kicker = null;
Agreed. Caution is in order, however, because interrupt() does not generally terminate a thread. It just sets it "interrupted" flag, or causes it to throw an exception (e.g. InterruptedException) when it was sleeping, waiting, blocking on I/O, etc. To ensure that a thread terminates after it's interrupt() method is called, you need to both catch these exceptions and periodically check its "interrupted" flag to detect interrupts, and make it react by exiting its run() method. [STOP MICROSOFT WEBMAIL SUPER INDENT] yes . i assumed that a long running thread was i a loop while(kicker != null)} } is this enough? sometimes(not in mmbase) I see code like this: Thread thisThread = Thread.currentThread(); while(Thread.currentThread() == thisThread) any idea why?
<<winmail.dat>>
