com.hammurapi.util.concurrent
Class CountedRunnable
java.lang.Object
com.hammurapi.util.concurrent.CountedRunnable
- All Implemented Interfaces:
- Runnable
public class CountedRunnable
- extends Object
- implements Runnable
This class increments counter when created and
decrements when run() method exits. When counter reaches zero, this
class invokes notifyAll() on the counter. The class shall be used for
parallel execution of tasks when it is required to wait until all tasks
complete.
- Author:
- Pavel Vlasov
|
Method Summary |
void |
run()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CountedRunnable
public CountedRunnable(CountedRunnable.Counter counter,
Runnable master)
run
public final void run()
- Specified by:
run in interface Runnable