-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually connect and run a test with jcstress
- Loading branch information
1 parent
1b2645c
commit c5160dc
Showing
6 changed files
with
55 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
target/ | ||
libs/ | ||
results/ | ||
*.bin.gz | ||
test.iml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.sample; | ||
|
||
import komem.litmus.LitmusTest; | ||
import kotlin.Unit; | ||
import kotlin.jvm.functions.Function1; | ||
import komem.litmus.testsuite.ClassicTestsKt; | ||
import org.openjdk.jcstress.annotations.*; | ||
import org.openjdk.jcstress.infra.results.II_Result; | ||
|
||
import java.util.List; | ||
|
||
@JCStressTest | ||
@State | ||
public class LitmusSB { | ||
|
||
private static final LitmusTest<Object> sb = (LitmusTest<Object>) ClassicTestsKt.getSB(); | ||
private static final Function1<Object, Unit> fT0 = sb.getThreadFunctions().get(0); | ||
private static final Function1<Object, Unit> fT1 = sb.getThreadFunctions().get(1); | ||
private static final Function1<Object, Object> fA = sb.getOutcomeFinalizer(); | ||
|
||
public LitmusSB() { | ||
} | ||
|
||
public Object state = sb.getStateProducer().invoke(); | ||
|
||
@Actor | ||
public void t1() { | ||
fT0.invoke(state); | ||
} | ||
|
||
@Actor | ||
public void t2() { | ||
fT1.invoke(state); | ||
} | ||
|
||
@Arbiter | ||
public void a(II_Result r) { | ||
List<Integer> result = (List<Integer>) fA.invoke(state); | ||
r.r1 = result.get(0); | ||
r.r2 = result.get(1); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters