public class TreeBarrier extends Object
Constructor and Description |
---|
TreeBarrier(int parties)
Creates a new Tree Barrier for synchronization
|
Modifier and Type | Method and Description |
---|---|
void |
await(int ID)
Waits for all threads to reach this barrier.
|
public TreeBarrier(int parties)
parties
- the number of threads that must arrive to synchronizepublic void await(int ID) throws InterruptedException
ID
- the id of the thread attempting to reach the barrier.InterruptedException
- if one of the threads was interrupted
while waiting on the barrierCopyright © 2017. All rights reserved.