pablo wrote:
> I have a big thread problem in Java. I need to kill a thread that is
> the issue. But when I try to kill a thread (with a jni API to C) the
> JVM doesn't deregister this thread. Somebody can help me please.
What are you doing here?!! Let me guess... you're making a JNI
call to actually kill a Java thread, using the kill syscall on
Linux! (Bingo?)
What is your motivation?
> The only thing I need is kill a thread, but when I want not with a
> clean stop procedure, like Sun recomend against thread.stop() method.
Let the thread die of its own. If you want to do something close
to killing a thread, have the run method make a check like this:
public void run()
{
for (;

{
if (Thread.interrupted())
break;
[...]
}
}
From outside of this thread, you just call Thread.interrupt()
on it. Also, if you're calling sleep() on the thread, then you
should catch InterruptedException and break from there.
-Manish
--
Manish Jethani (manish.j at gmx.net)
phone (work) +91-80-51073488