add next test case
[IRC.git] / Robust / src / Tests / Atomic2.java
1 public class Atomic2 extends Thread {
2     public Atomic2() {
3     }
4     int count;
5     public static void main(String[] st) {
6         int mid = (128<<24)|(200<<16)|(9<<8)|26;
7         Atomic2 t =null;
8         atomic {
9             t= global new Atomic2();
10             t.count=0;
11         }
12         System.printString("Starting\n");
13         t.start(mid);
14         System.printString("Finished\n");
15         //this is ugly...
16         while(true) {
17             atomic {
18                 t.count++;
19             }
20         }
21     }
22
23     public int run() {
24         while(true) {
25             int tmpcount;
26             atomic {
27                 tmpcount=count;
28             }
29             System.printString("Current count=");
30             System.printInt(tmpcount);
31             System.printString("\n");
32         }
33     }
34 }
35