1 public class threadInterrupt {
2 public static class firstthread implements Runnable {
3 private threadInterrupt s;
5 public firstthread(threadInterrupt s_) {
11 System.out.println("first thread!");
13 System.out.println("interrupting");
15 System.out.println("leaving");
17 } catch (Exception e) {
23 public static class secondthread implements Runnable {
24 private threadInterrupt s;
26 public secondthread(threadInterrupt s_) {
33 System.out.println("second thread!");
36 } catch (Exception e) {
42 public Object o1 = new Object();
43 public Thread t1 = null;
44 public Thread t2 = null;
46 public static void main(String args[]) {
47 System.out.println("should exit with java.lang.InterruptedException");
48 threadInterrupt s = new threadInterrupt();
49 firstthread r1 = new firstthread(s);
50 secondthread r2 = new secondthread(s);
52 s.t1 = new Thread(r1, "a");
53 s.t2 = new Thread(r2, "b");
60 * These are local overrides for various environment variables in Emacs.
61 * Please do not remove this and leave it at the end of the file, where
62 * Emacs will automagically detect them.
63 * ---------------------------------------------------------------------
70 * vim:noexpandtab:sw=4:ts=4: