Interface SynchronizerApi.Get.Invoke<T>
-
- All Superinterfaces:
SynchronizerApi.Fluent
- All Known Subinterfaces:
SynchronizerApi.Get.SleepInvoke<T>
,SynchronizerApi.Get.WakeSleepInvoke<T>
- Enclosing interface:
- SynchronizerApi.Get
public static interface SynchronizerApi.Get.Invoke<T> extends SynchronizerApi.Fluent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
invoke()
Invokes the action chain in a synchronized block.
-
-
-
Method Detail
-
invoke
@CanIgnoreReturnValue T invoke()
Invokes the action chain in a synchronized block.
All actions will be performed in order. This method blocks until all actions in the chain have been completed.
While several action chains can be invoked concurrently on the same synchronizer, only one of them will perform an action at any given time. As this involves acquiring a lock shared with other action chains, care must be taken to avoid deadlocks, just as if usingsynchronized
blocks andObject.wait()
/Object.notifyAll()
directly.- Returns:
- the object returned by the main action
- Throws:
UncheckedInterruptedException
- if the thread was interrupted while waiting (i.e. performing a sleep action).
-
-