1 // This test has been added because of a bug in CACAO that allowed threads
2 // blocked inside monitorenter to be interrupted. In the presence of the bug,
3 // the program would not exit.
5 // The bug has been fixed as part of the sable lock implementation.
6 // hg revision 2988182011bb ff (Wed Feb 06 18:46:34 2008 +0100)
8 public class threadInterrupt {
9 public static class firstthread implements Runnable {
10 private threadInterrupt s;
12 public firstthread(threadInterrupt s_) {
18 System.out.println("first thread!");
20 System.out.println("interrupting");
22 System.out.println("leaving");
24 } catch (Exception e) {
30 public static class secondthread implements Runnable {
31 private threadInterrupt s;
33 public secondthread(threadInterrupt s_) {
40 System.out.println("second thread!");
43 } catch (Exception e) {
49 public Object o1 = new Object();
50 public Thread t1 = null;
51 public Thread t2 = null;
53 public static void main(String args[]) {
54 System.out.println("should exit with java.lang.InterruptedException");
55 threadInterrupt s = new threadInterrupt();
56 firstthread r1 = new firstthread(s);
57 secondthread r2 = new secondthread(s);
59 s.t1 = new Thread(r1, "a");
60 s.t2 = new Thread(r2, "b");
67 * These are local overrides for various environment variables in Emacs.
68 * Please do not remove this and leave it at the end of the file, where
69 * Emacs will automagically detect them.
70 * ---------------------------------------------------------------------
77 * vim:noexpandtab:sw=4:ts=4: