public class Rendezvous
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Rendezvous.Counter
class encapsulating state for a specific rendezvous
|
Modifier and Type | Field and Description |
---|---|
private Rendezvous.Counter |
counter
the current counter for this rendezvous
|
private int |
expected
the number of threads which are expected to arrive at this rendezvous
|
private boolean |
isDeleted
true if a rendezvous was deleted while a rendezbvous was in progress but had not completed
|
private boolean |
needsRemove
true if a non-restartable rendezvous has completed and has not been removed from the rendezvous map
|
private boolean |
rejoinable
true if this rendezvous can be repeatedly joined, false it it is a one-off meeting
|
Constructor and Description |
---|
Rendezvous(int expected) |
Rendezvous(int expected,
boolean rejoinable) |
Modifier and Type | Method and Description |
---|---|
boolean |
delete()
delete this rendezvous causing any waiting threads to return -1 form the rendezvous call.
|
int |
getArrived()
retrieve the number of threads waiting at the rendezvous or -1 if the rendezvous has
been deleted
|
int |
getExpected() |
boolean |
needsRemove()
check if the rendezvous has completed but has not yet been rtemoved
|
int |
rendezvous()
enter this rendezvous.
|
void |
setRemoved()
mark a completed rendezvous to indicate that it has been removed
|
private int expected
private Rendezvous.Counter counter
private boolean rejoinable
private boolean isDeleted
private boolean needsRemove
public Rendezvous(int expected)
public Rendezvous(int expected, boolean rejoinable)
public int rendezvous()
public boolean delete()
public int getExpected()
public int getArrived()
public boolean needsRemove()
public void setRemoved()