FileDocCategorySizeDatePackage
ThreadDeathCatch.javaAPI DocExample2871Thu Mar 25 21:30:24 GMT 2004None

ThreadDeathCatch

public class ThreadDeathCatch extends Object
Catch a ThreadDeath by hitting a Thread with stop.

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		try {
			Thread t = new Thread() {
				public void run() {
					try {
						Thread.sleep(2500);
					} catch (Throwable ex)  {
						System.out.println("Caught in run: " + ex);
					}
				}
			};
			t.start();
			// Give t time to get going...
			Thread.sleep(1000);
			t.stop();				// EXPECT COMPILER WARNING
		} catch (Throwable t) {
			System.out.println("Caught in main: " + t);
		}