Duplicate :
|
|
Relates :
|
|
Relates :
|
The CR 4519200 "(thread) Started thread does not terminate immediately if it was stopped before" has a Fix Delivered state, but the following example still fails: -------------------------------------------------------------- public class test { public static void main(String[] argv) { A a = new A(); a.stop(); a.start(); try { a.join(); } catch (Throwable e) { System.out.println("Unexpected exception" + e); } if(a.state) { System.out.println("Passed"); } else { System.out.println("Failed"); } } } class A extends Thread { public volatile boolean state = true; public void run() { state = false; } } -------------------------------------------------------------- The evalutation of CR 4519200 contains the following note: "The latency of thread stoppage will typically be 1-3 bytecodes...". So either the spec should mention stoppage latency or implementation should be fixed to terminate stopped thread immediately.
|