Class Rendezvous
- java.lang.Object
-
- org.jboss.byteman.synchronization.Rendezvous
-
public class Rendezvous extends java.lang.Objectclass used to manage rule rendezvous operations
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classRendezvous.Counterclass encapsulating state for a specific rendezvous
-
Field Summary
Fields Modifier and Type Field Description private Rendezvous.Countercounterthe current counter for this rendezvousprivate intexpectedthe number of threads which are expected to arrive at this rendezvousprivate booleanisDeletedtrue if a rendezvous was deleted while a rendezbvous was in progress but had not completedprivate booleanneedsRemovetrue if a non-restartable rendezvous has completed and has not been removed from the rendezvous mapprivate booleanrejoinabletrue if this rendezvous can be repeatedly joined, false it it is a one-off meeting
-
Constructor Summary
Constructors Constructor Description Rendezvous(int expected)Rendezvous(int expected, boolean rejoinable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete()delete this rendezvous causing any waiting threads to return -1 form the rendezvous call.intgetArrived()retrieve the number of threads waiting at the rendezvous or -1 if the rendezvous has been deletedintgetExpected()booleanneedsRemove()check if the rendezvous has completed but has not yet been removedintrendezvous(long millis)enter this rendezvous.voidsetRemoved()mark a completed rendezvous to indicate that it has been removed
-
-
-
Field Detail
-
expected
private int expected
the number of threads which are expected to arrive at this rendezvous
-
counter
private Rendezvous.Counter counter
the current counter for this rendezvous
-
rejoinable
private boolean rejoinable
true if this rendezvous can be repeatedly joined, false it it is a one-off meeting
-
isDeleted
private boolean isDeleted
true if a rendezvous was deleted while a rendezbvous was in progress but had not completed
-
needsRemove
private boolean needsRemove
true if a non-restartable rendezvous has completed and has not been removed from the rendezvous map
-
-
Method Detail
-
rendezvous
public int rendezvous(long millis)
enter this rendezvous. n.b. this must be called synchronized on the rendezvous object in question- Parameters:
millis- how long to wait (wait forever if 0)- Returns:
- the index in arrival order from 0 to expected of the calling thread or -1 if either the rendezvous has completed and is not restartable or the rendezvous has been deleted
-
delete
public boolean delete()
delete this rendezvous causing any waiting threads to return -1 form the rendezvous call. n.b. this must be called synchronized on the rendezvous object in question- Returns:
- false if a delete has already been requested otherwise true
-
getExpected
public int getExpected()
-
getArrived
public int getArrived()
retrieve the number of threads waiting at the rendezvous or -1 if the rendezvous has been deleted- Returns:
- number of threads waiting or -1
-
needsRemove
public boolean needsRemove()
check if the rendezvous has completed but has not yet been removed- Returns:
- the above
-
setRemoved
public void setRemoved()
mark a completed rendezvous to indicate that it has been removed
-
-