* tests/weakref.java: New test for weak references.
[cacao.git] / tests / stack / sleep_exception.java
1 import java.util.*;
2
3 public class sleep_exception extends Thread {
4     public static Random r = new Random();
5
6     public sleep_exception (String name) {
7         super(name);
8     }
9
10     public void run() {
11         for (int i = 0; i < 10; ++i) {
12             System.out.println(getName());
13             try {
14                 throw new Exception("Exception in thread");
15             } catch (Exception e) {
16               e.printStackTrace();
17             }
18             try {
19                 sleep((long) (r.nextFloat() * 1000));
20             } catch (Exception e) {
21                 e.printStackTrace();
22             }
23         }
24     }
25
26     public static void main(String args[]) {
27         sleep_exception t1 = new sleep_exception("a");
28         sleep_exception t2 = new sleep_exception("b");
29
30         t1.start();
31         t2.start();
32     }
33 }