| |
|
| java.lang.Object com.clarkware.junitperf.ThreadBarrier
ThreadBarrier | public class ThreadBarrier (Code) | | The ThreadBarrier class provides a callback
method for threads to signal their completion.
author: Mike Clark author: Clarkware Consulting, Inc. |
Constructor Summary | |
public | ThreadBarrier(int numDispatched) Constructs a ThreadBarrier with the
specified number of threads to wait for. |
Method Summary | |
public synchronized void | cancelThreads(int threadCount) Cancels the specified number of threads. | public boolean | isReached() Determines whether the thread barrier has been reached -
when all dispatched threads have returned. | public synchronized void | onCompletion(Thread t) Called when the specified thread is complete. |
dispatchedCount | final public int dispatchedCount(Code) | | |
returnedCount | public int returnedCount(Code) | | |
ThreadBarrier | public ThreadBarrier(int numDispatched)(Code) | | Constructs a ThreadBarrier with the
specified number of threads to wait for.
Parameters: numDispatched - Number of threads dispatched. |
cancelThreads | public synchronized void cancelThreads(int threadCount)(Code) | | Cancels the specified number of threads.
Parameters: threadCount - Number of threads to cancel. |
isReached | public boolean isReached()(Code) | | 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 synchronized void onCompletion(Thread t)(Code) | | Called when the specified thread is complete.
Parameters: t - Completed thread. |
|
|
|