The Thread.stop() method is flawed in JDK 1.0.2 for Windows 95. If a
thread calls stop() on itself, that thread is hung without being
properly cleaned up, and when the application (not applet) attempts to
exit, the application hangs forever (probably waiting for the hung
thread to terminate or something).
It does work when run using jdb however.
Here is the test program:
class StopSelf implements Runnable {
public
void run() {
Thread.currentThread().stop();
System.out.println("After stop?");
}
static public
void main(String vSt[]) {
new Thread(new StopSelf(), "StopSelf").start();
}
}
thread calls stop() on itself, that thread is hung without being
properly cleaned up, and when the application (not applet) attempts to
exit, the application hangs forever (probably waiting for the hung
thread to terminate or something).
It does work when run using jdb however.
Here is the test program:
class StopSelf implements Runnable {
public
void run() {
Thread.currentThread().stop();
System.out.println("After stop?");
}
static public
void main(String vSt[]) {
new Thread(new StopSelf(), "StopSelf").start();
}
}
- duplicates
-
JDK-1234319 Win32 only: program with multiple threads crashes after running for a while
- Closed