Class ExclusiveResource
java.lang.Object
org.junit.platform.engine.support.hierarchical.ExclusiveResource
An exclusive resource identified by a key with a lock mode that is used to
synchronize access to shared resources when executing nodes in parallel.
- Since:
- 1.3
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumLockModetranslates to the respectiveReadWriteLocklocks. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey of the global resource lock that all direct children of the engine descriptor acquire in read mode by default.(package private) static final ExclusiveResource(package private) static final ExclusiveResourceprivate intprivate final Stringprivate final ExclusiveResource.LockMode -
Constructor Summary
ConstructorsConstructorDescriptionExclusiveResource(String key, ExclusiveResource.LockMode lockMode) Create a newExclusiveResource. -
Method Summary
-
Field Details
-
GLOBAL_KEY
Key of the global resource lock that all direct children of the engine descriptor acquire in read mode by default.If any node requires an exclusive resource with the same key in read-write mode, the lock will be coarsened to be acquired by the node's ancestor that is a direct child of the engine descriptor and all of the ancestor's descendants will be forced to run in the same thread.
- Since:
- 1.7
- See Also:
-
GLOBAL_READ
-
GLOBAL_READ_WRITE
-
key
-
lockMode
-
hash
private int hash
-
-
Constructor Details
-
ExclusiveResource
Create a newExclusiveResource.- Parameters:
key- the identifier of the resource; nevernullor blanklockMode- the lock mode to use to synchronize access to the resource; nevernull
-
-
Method Details