public class AllInterleavings extends Object implements AutoCloseable
try (AllInterleavings allInterleavings =
new AllInterleavings("ConcurrencyTestUniqueId");) {
while (allInterleavings.hasNext()) {
firstId = 0L;
secondId = 0L;
UniqueId uniqueId = new UniqueId();
Thread first = new Thread(() -> {
firstId = uniqueId.nextId();
});
first.start();
secondId = uniqueId.nextId();
first.join();
assertTrue(firstId != secondId);
}
}
Modifier and Type | Field and Description |
---|---|
int |
maximumRuns
see
AllInterleavingsBuilder.maximumRuns(int) for a description and how to set this value. |
int |
maximumSynchronizationActionsPerThread
see
AllInterleavingsBuilder.maximumSynchronizationActionsPerThread(int) for a description and how to set this value. |
String |
name
The name shown in the interleave report.
|
Class[] |
removeAtomicAnnotationFromClassArray
see
AllInterleavingsBuilder.removeAtomicAnnotation(java.lang.Class) for a description and how to set this value. |
boolean |
showNonVolatileSharedMemoryAccess
see
AllInterleavingsBuilder.showNonVolatileSharedMemoryAccess for a description and how to set this value. |
boolean |
showStatementsInExecutor
see
AllInterleavingsBuilder.showStatementsInExecutor for a description and how to set this value. |
boolean |
showStatementsWhenSingleThreaded
see
AllInterleavingsBuilder.showStatementsWhenSingleThreaded for a description and how to set this value. |
Constructor and Description |
---|
AllInterleavings(String name)
Creates a new AllInterleavings instance.
|
Modifier and Type | Method and Description |
---|---|
static AllInterleavingsBuilder |
builder(String name)
Create a new
AllInterleavingsBuilder . |
void |
close()
closes this instance
|
boolean |
hasNext()
Return true if there are still thread interleavings to be executed and select the next thread interleaving.
|
public final String name
public final boolean showStatementsWhenSingleThreaded
AllInterleavingsBuilder.showStatementsWhenSingleThreaded
for a description and how to set this value.public final boolean showStatementsInExecutor
AllInterleavingsBuilder.showStatementsInExecutor
for a description and how to set this value.public final boolean showNonVolatileSharedMemoryAccess
AllInterleavingsBuilder.showNonVolatileSharedMemoryAccess
for a description and how to set this value.public final int maximumRuns
AllInterleavingsBuilder.maximumRuns(int)
for a description and how to set this value.public final int maximumSynchronizationActionsPerThread
AllInterleavingsBuilder.maximumSynchronizationActionsPerThread(int)
for a description and how to set this value.public final Class[] removeAtomicAnnotationFromClassArray
AllInterleavingsBuilder.removeAtomicAnnotation(java.lang.Class)
for a description and how to set this value.public AllInterleavings(String name)
AllInterleavingsBuilder
name
- The name shown in the interleave report.public static AllInterleavingsBuilder builder(String name)
AllInterleavingsBuilder
.name
- The name shown in the interleave report.AllInterleavingsBuilder
public boolean hasNext()
public void close()
close
in interface AutoCloseable
Copyright © 2020 vmlens. All rights reserved.