From 350c2b6d3f4305f5521d263c88255d88ab644075 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Sat, 15 Sep 2007 07:40:37 +0000 Subject: [PATCH] add next test case --- Robust/src/Tests/Atomic2.java | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Robust/src/Tests/Atomic2.java 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"); + } + } +} + -- 2.34.1