OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [PR18699.java] - Blame information for rev 767

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
// Test for thread-local allocation problems.
2
 
3
import java.util.HashMap;
4
import java.util.Observable;
5
import java.util.Observer;
6
 
7
class PR18699 extends Observable implements Runnable, Observer {
8
 
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();
16
  }
17
 
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);
27
    }
28
  }
29
 
30
  HashMap map = new HashMap();
31
 
32
  public void update(Observable o, Object obj)
33
  {
34
    map.put(o, obj);
35
  }
36
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.