public interface CriticalSectionExecutor
This interface abstract the underlying mechanism used for synchronization: Locks, Semaphores, distributed coordination (for distributed critical sections), etc.
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Instruction instruction)
Executes a set of instructions as critical section (Mutual excluded).
|
void |
execute(Instruction instruction,
javax.measure.Measurable<javax.measure.quantity.Duration> timeout)
Executes a set of instructions as critical section (Mutual excluded).
|
<T> T |
execute(Procedure<T> procedure)
Executes a procedure as critical section (Mutual excluded).
|
<T> T |
execute(Procedure<T> procedure,
javax.measure.Measurable<javax.measure.quantity.Duration> timeout)
Executes a procedure as critical section (Mutual excluded).
|
void execute(Instruction instruction)
instruction - instruction to executevoid execute(Instruction instruction, javax.measure.Measurable<javax.measure.quantity.Duration> timeout) throws TimeoutException
instruction - instruction to executetimeout - the maximum time to wait, null to wait indefinitelyTimeoutException - if the operation times out<T> T execute(Procedure<T> procedure)
procedure - procedure to execute<T> T execute(Procedure<T> procedure, javax.measure.Measurable<javax.measure.quantity.Duration> timeout) throws TimeoutException
procedure - procedure to executetimeout - the maximum time to wait, null to wait indefinitelyTimeoutException - if the operation times outCopyright © 2014. All Rights Reserved.