com.clarkware.junitperf
public class ThreadBarrier extends Object
ThreadBarrier
class provides a callback
method for threads to signal their completion.
Field Summary | |
---|---|
int | dispatchedCount |
int | returnedCount |
Constructor Summary | |
---|---|
ThreadBarrier(int numDispatched)
Constructs a ThreadBarrier with the
specified number of threads to wait for.
|
Method Summary | |
---|---|
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.
|
ThreadBarrier
with the
specified number of threads to wait for.
Parameters: numDispatched Number of threads dispatched.
Parameters: threadCount Number of threads to cancel.
Returns: true
if the barrier has been reached;
false
otherwise.
Parameters: t Completed thread.