[[ thread-safe.org ]]

Output for Data Race Example

Starting to check tso.examples.SimpleDataRace
Trying random seed 1

==== Found a thread safety violation! ====
Sequential prefix:
final tso.examples.SimpleDataRace var0 = new tso.examples.SimpleDataRace();
final int var1 = var0.testAndUse();
final int var2 = var0.testAndUse();
final int var3 = var0.testAndUse();
final int var4 = var0.testAndUse();
final int var5 = var0.testAndUse();

Concurrent suffixes:

final int var6 = var0.testAndUse();
var0.toggle();

vs.

final int var6 = var0.testAndUse();
var0.toggle();

java.lang.RuntimeException: java.lang.NullPointerException: Calling 'hashCode()I' on null object
	at Test1_1$2.run(Test1_1.java:41)
Caused by: java.lang.NullPointerException: Calling 'hashCode()I' on null object
	at tso.examples.SimpleDataRace.testAndUse(SimpleDataRace.java:20)
	at Test1_1$2.run(Test1_1.java:36)

Done after 5 seconds
Download a test that triggers the problem