com.hammurapi.common.concurrent

## Class CountedRunnable

- java.lang.Object
- - com.hammurapi.common.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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CountedRunnable.Counter` Counter to use with CounterRunnable.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CountedRunnable(CountedRunnable.Counter counter, Runnable master)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `run()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CountedRunnable

          public CountedRunnable(CountedRunnable.Counter counter,
                         Runnable master)

  - ### Method Detail

    - #### run

          public final void run()

      Specified by:
        `run` in interface `Runnable`