com.clarkware.junitperf
Class ThreadBarrier
java.lang.Objectcom.clarkware.junitperf.ThreadBarrier
public class ThreadBarrier
extends java.lang.Object
The ThreadBarrier class provides a callback
method for threads to signal their completion.
- Mike Clark
- Clarkware Consulting, Inc.
ThreadBarrier(int numDispatched)- Constructs a
ThreadBarrier with the
specified number of threads to wait for.
|
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(Thread t)- Called when the specified thread is complete.
|
dispatchedCount
public final int dispatchedCount
returnedCount
public int returnedCount
ThreadBarrier
public ThreadBarrier(int numDispatched)
Constructs a ThreadBarrier with the
specified number of threads to wait for.
numDispatched - Number of threads dispatched.
cancelThreads
public void cancelThreads(int threadCount)
Cancels the specified number of threads.
threadCount - Number of threads to cancel.
isReached
public boolean isReached()
Determines whether the thread barrier has been reached -
when all dispatched threads have returned.
true if the barrier has been reached;
false otherwise.
onCompletion
public void onCompletion(Thread t)
Called when the specified thread is complete.
Copyright B) 1999-2005 Clarkware Consulting, Inc.