multithreading - Interactions between Java threads -
this question has answer here:
- stopping thread in java 1 answer
i have 2 classes (a & b) implements runnable.
both threads executed in way:
a = new a(); new thread(a).start(); b b = new b(); new thread(b).start();
i need stop/wait/resume thread inside thread b.
how it's possible?
actually, can't stop tread.as markspace commented, possible, should , in special cases
java thread primitive deprecation
why is thread.stopdeprecated?
because inherently unsafe. stopping thread causes unlock monitors has locked. (the monitors unlocked thethreaddeath exception propagates stack.)
Comments
Post a Comment