From: bdemsky Date: Sat, 15 Sep 2007 07:40:37 +0000 (+0000) Subject: add next test case X-Git-Tag: preEdgeChange~436 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=350c2b6d3f4305f5521d263c88255d88ab644075;p=IRC.git add next test case --- diff --git a/Robust/src/Tests/Atomic2.java b/Robust/src/Tests/Atomic2.java new file mode 100644 index 00000000..4dbf1736 --- /dev/null +++ b/Robust/src/Tests/Atomic2.java @@ -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"); + } + } +} +