adding a test case
[IRC.git] / Robust / src / Tests / STM.java
1 /* This test case tests the thread joining for a JavaSTM classlibrary */ 
2 public class STM extends Thread {
3   Data x;
4   public STM(Data x) {
5     this.x=x;
6   }
7   public static void main(String[] st) {
8     Data d=new Data();
9     STM s1=new STM(d);
10     STM s2=new STM(d);
11     
12     s1.start();
13     s2.start();
14     s1.join();
15     s2.join();
16   }
17   
18   public void run() {
19     int i;
20     //    for(int j=0;j<10;j++) {
21         atomic {
22             i=x.a++;
23         }
24         //    }
25     System.out.println("Initial value:"+i);
26   }
27 }
28
29 public class Data {
30   int a;
31   public Data() {
32   }
33 }