Class SynchronizationBarrier
- java.lang.Object
-
- net.timewalker.ffmq4.utils.concurrent.SynchronizationBarrier
-
public final class SynchronizationBarrier extends Object
SynchronizationBarrier
-
-
Constructor Summary
Constructors Constructor Description SynchronizationBarrier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddParty()Increment the number of involved partiesbooleanisReached()Test if the synchronization point was reachedvoidreach()Indicate that the current thread reached the synchronization barrier.voidreset()Reset the synchronization barriervoidwaitFor()Wait for the synchronization point to be reached.
-
-
-
Method Detail
-
addParty
public void addParty()
Increment the number of involved parties
-
isReached
public boolean isReached()
Test if the synchronization point was reached
-
waitFor
public void waitFor() throws InterruptedExceptionWait for the synchronization point to be reached. Returns immediately if the sync. point is already reached.- Throws:
InterruptedException
-
reach
public void reach()
Indicate that the current thread reached the synchronization barrier. If all parties have reached the barrier, this wakes up all waiting threads.
-
reset
public void reset()
Reset the synchronization barrier
-
-