Package com.vmlens.api
Class AllInterleavingsBuilder
- java.lang.Object
-
- com.vmlens.api.AllInterleavingsBuilder
-
public class AllInterleavingsBuilder extends Object
Use this builder to build AllInterleavings instances with a non default configuration. Example:try (AllInterleavings testUpdate = AllInterleavings.builder("TestShowSharedMemory").showStatementsWhenSingleThreaded().showNonVolatileSharedMemoryAccess().build();) { while( testUpdate.hasNext() ) { } }
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AllInterleavings
build()
Builds a new instance of the class AllInterleavings with the given properties.AllInterleavingsBuilder
maximumRuns(int maximum)
AllInterleavings terminates when no more interleavings are available or the maximumRuns count is reached.AllInterleavingsBuilder
maximumSynchronizationActionsPerThread(int maximum)
If a thread executes more than the given maximum synchronization actions it gets terminated by an exception.AllInterleavingsBuilder
removeAtomicAnnotation(Class cl)
Removes the atomic annotation from the given class.AllInterleavingsBuilder
showNonVolatileSharedMemoryAccess()
Also show non volatile memory access in the interleave report.AllInterleavingsBuilder
showStatementsInExecutor()
Show statements in the interleave report when inside one of the methods of classes implementing java.util.concurrent.Executor like java.util.concurrent.ThreadPoolExecutor or java.util.concurrent.ForkJoinPool Statements are synchronization actions and whenshowNonVolatileSharedMemoryAccess
was called also non volatile memory access.AllInterleavingsBuilder
showStatementsWhenSingleThreaded()
Show statements in the interleave report also when only one thread is currently running.
-
-
-
Method Detail
-
build
public AllInterleavings build()
Builds a new instance of the class AllInterleavings with the given properties.- Returns:
- new instance of the class AllInterleavings with the given properties.
-
removeAtomicAnnotation
public AllInterleavingsBuilder removeAtomicAnnotation(Class cl)
Removes the atomic annotation from the given class.- Parameters:
cl
- The class for which the annotation should be removed.- Returns:
- This builder
-
showStatementsWhenSingleThreaded
public AllInterleavingsBuilder showStatementsWhenSingleThreaded()
Show statements in the interleave report also when only one thread is currently running. Statements are synchronization actions and whenshowNonVolatileSharedMemoryAccess
was called also non volatile memory access.- Returns:
- This builder
-
showStatementsInExecutor
public AllInterleavingsBuilder showStatementsInExecutor()
Show statements in the interleave report when inside one of the methods of classes implementing java.util.concurrent.Executor like java.util.concurrent.ThreadPoolExecutor or java.util.concurrent.ForkJoinPool Statements are synchronization actions and whenshowNonVolatileSharedMemoryAccess
was called also non volatile memory access.- Returns:
- This builder
-
showNonVolatileSharedMemoryAccess
public AllInterleavingsBuilder showNonVolatileSharedMemoryAccess()
Also show non volatile memory access in the interleave report.- Returns:
- This builder
-
maximumRuns
public AllInterleavingsBuilder maximumRuns(int maximum)
AllInterleavings terminates when no more interleavings are available or the maximumRuns count is reached. Set the maximum to -1 to only terminate when no more interleavings are available. Default value when not set through this method: 5000- Parameters:
maximum
- The new maximum run count- Returns:
- This builder
-
maximumSynchronizationActionsPerThread
public AllInterleavingsBuilder maximumSynchronizationActionsPerThread(int maximum)
If a thread executes more than the given maximum synchronization actions it gets terminated by an exception. Set the maximum to -1 to never terminate a thread with this mechanism. Default value when not set through this method: 2000- Parameters:
maximum
- The new maximum synchronization actions per thread.- Returns:
- This builder
-
-