jmm: Java Memory Model companion code (volatile, happens-before, DCL)
Runnable jcstress + JUnit companion for the ankurm.com post on the Java Memory Model, double-checked locking, and the volatile fix.
This commit is contained in:
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# Quick ad hoc jcstress run against one test class, printed to the terminal instead of
|
||||
# a captured output/ file. Example:
|
||||
# ./scripts/run.sh PlainPublicationTest
|
||||
# ./scripts/run.sh PlainPublicationTest -m tough # extra args pass straight through
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
TEST="${1:?Usage: run.sh <TestClassName> [extra jcstress args]}"
|
||||
shift || true
|
||||
|
||||
JAR=target/jcstress.jar
|
||||
[ -f "$JAR" ] || { echo "Run 'mvn package' first."; exit 1; }
|
||||
|
||||
java -jar "$JAR" -t "$TEST" -jvmArgs "-Xmx256m" -f 2 -iters 15 -time 1000 -v "$@"
|
||||
Reference in New Issue
Block a user