From 0d20e4e61d088ab7414f966013c9b3adfe0e4449 Mon Sep 17 00:00:00 2001 From: jjenista Date: Tue, 7 Sep 2010 19:32:34 +0000 Subject: [PATCH] a test case for shutting down ooojava work threads gracefully --- .../Tests/oooJava/runtime-shutdown/makefile | 29 +++++++++++++++++++ .../Tests/oooJava/runtime-shutdown/test.java | 24 +++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 Robust/src/Tests/oooJava/runtime-shutdown/makefile create mode 100644 Robust/src/Tests/oooJava/runtime-shutdown/test.java diff --git a/Robust/src/Tests/oooJava/runtime-shutdown/makefile b/Robust/src/Tests/oooJava/runtime-shutdown/makefile new file mode 100644 index 00000000..6a742941 --- /dev/null +++ b/Robust/src/Tests/oooJava/runtime-shutdown/makefile @@ -0,0 +1,29 @@ +PROGRAM=Test + +SOURCE_FILES=test.java + +BUILDSCRIPT=../../../buildscript + +USEOOO= -ooojava 2 2 -ooodebug +BSFLAGS= -64bit -mainclass $(PROGRAM) -garbagestats -joptimize -noloop -optimize -coreprof -coreprof-checkoverflow -debug +DISJOINT= -disjoint -disjoint-k 1 -enable-assertions #-disjoint-desire-determinism + +default: + $(BUILDSCRIPT) -nojava $(USEOOO) $(BSFLAGS) $(DISJOINT) -o $(PROGRAM)p $(SOURCE_FILES) -builddir par + +single: + $(BUILDSCRIPT) $(BSFLAGS) -thread -o $(PROGRAM)s -builddir sing $(SOURCE_FILES) + +ooo: + $(BUILDSCRIPT) $(USEOOO) $(BSFLAGS) $(DISJOINT) -o $(PROGRAM)p -builddir par $(SOURCE_FILES) + +clean: + rm -f $(PROGRAM)p.bin $(PROGRAM)s.bin + rm -fr par sing + rm -f *~ + rm -f *.dot + rm -f *.png + rm -f *.txt + rm -f aliases.txt + rm -f mlpReport*txt + rm -f results*txt diff --git a/Robust/src/Tests/oooJava/runtime-shutdown/test.java b/Robust/src/Tests/oooJava/runtime-shutdown/test.java new file mode 100644 index 00000000..84072799 --- /dev/null +++ b/Robust/src/Tests/oooJava/runtime-shutdown/test.java @@ -0,0 +1,24 @@ +public class Foo { + public int z; + public Foo() {} +} + +public class Test { + + static public void main( String args[] ) { + + int x = 0; + + for( int i = 0; i < 200; ++i ) { + rblock a { + Foo f = new Foo(); + f.z = 1; + } + rblock b { + x += f.z; + } + } + + System.out.println( x ); + } +} -- 2.34.1