public class ThreadBarrier
extends java.lang.Object
ThreadBarrier
class provides a callback
method for threads to signal their completion.Modifier and Type | Field | Description |
---|---|---|
int |
dispatchedCount |
|
int |
returnedCount |
Constructor | Description |
---|---|
ThreadBarrier(int numDispatched) |
Constructs a
ThreadBarrier with the
specified number of threads to wait for. |
Modifier and Type | Method | Description |
---|---|---|
void |
cancelThreads(int threadCount) |
Cancels the specified number of threads.
|
boolean |
isReached() |
Determines whether the thread barrier has been reached -
when all dispatched threads have returned.
|
void |
onCompletion(java.lang.Thread t) |
Called when the specified thread is complete.
|
public int returnedCount
public final int dispatchedCount
public ThreadBarrier(int numDispatched)
ThreadBarrier
with the
specified number of threads to wait for.numDispatched
- Number of threads dispatched.public void onCompletion(java.lang.Thread t)
t
- Completed thread.public boolean isReached()
true
if the barrier has been reached;
false
otherwise.public void cancelThreads(int threadCount)
threadCount
- Number of threads to cancel.Copyright ? 1999-2005 Clarkware Consulting, Inc.