add next test case
authorbdemsky <bdemsky>
Sat, 15 Sep 2007 07:40:37 +0000 (07:40 +0000)
committerbdemsky <bdemsky>
Sat, 15 Sep 2007 07:40:37 +0000 (07:40 +0000)
Robust/src/Tests/Atomic2.java [new file with mode: 0644]

diff --git a/Robust/src/Tests/Atomic2.java b/Robust/src/Tests/Atomic2.java
new file mode 100644 (file)
index 0000000..4dbf173
--- /dev/null
@@ -0,0 +1,35 @@
+public class Atomic2 extends Thread {
+    public Atomic2() {
+    }
+    int count;
+    public static void main(String[] st) {
+       int mid = (128<<24)|(200<<16)|(9<<8)|26;
+       Atomic2 t =null;
+       atomic {
+           t= global new Atomic2();
+           t.count=0;
+       }
+       System.printString("Starting\n");
+       t.start(mid);
+       System.printString("Finished\n");
+       //this is ugly...
+       while(true) {
+           atomic {
+               t.count++;
+           }
+       }
+    }
+
+    public int run() {
+       while(true) {
+           int tmpcount;
+           atomic {
+               tmpcount=count;
+           }
+           System.printString("Current count=");
+           System.printInt(tmpcount);
+           System.printString("\n");
+       }
+    }
+}
+