Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libjava / testsuite / libjava.lang / PR18699.java
blob6f81e10d9f358b3aca51241f29925675d60ccde7
1 // Test for thread-local allocation problems.
3 import java.util.HashMap;
4 import java.util.Observable;
5 import java.util.Observer;
7 class PR18699 extends Observable implements Runnable, Observer {
9 public static void main(String[] args) throws InterruptedException {
10 PR18699 PR18699_1 = new PR18699();
11 PR18699 PR18699_2 = new PR18699();
12 PR18699_1.addObserver(PR18699_2);
13 PR18699_2.addObserver(PR18699_1);
14 new Thread(PR18699_1).start();
15 new Thread(PR18699_2).start();
18 public void run() {
19 int c = 0;
20 String s = "";
21 while (++c < 50) {
22 this.setChanged();
23 s = "";
24 for (int i = 0; i < 200; i++)
25 s += String.valueOf(i);
26 this.notifyObservers(s);
30 HashMap map = new HashMap();
32 public void update(Observable o, Object obj)
34 map.put(o, obj);