Class MultiShotLatch


  • public final class MultiShotLatch
    extends Object
    Latch for synchronizing parts of code in tests. In contrast to OneShotLatch this will reset the state once await() returns.

    A part of the code that should only run after other code calls await(). The call will only return once the other part is finished and calls trigger().

    • Constructor Detail

      • MultiShotLatch

        public MultiShotLatch()
    • Method Detail

      • trigger

        public void trigger()
        Fires the latch. Code that is blocked on await() will now return.
      • isTriggered

        public boolean isTriggered()
        Checks if the latch was triggered.
        Returns:
        True, if the latch was triggered, false if not.