Interface DCountDownLatch

All Superinterfaces:
DType

public interface DCountDownLatch extends DType
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Causes the current thread to wait until the latch has counted down to zero, unless the thread is interrupted.
    boolean
    await(long timeout, TimeUnit unit)
    Causes the current thread to wait until the latch has counted down to zero, unless the thread is interrupted, or the specified waiting time has elapsed.
    long
    Decrements the count of the latch, releasing all waiting threads if the count reaches zero.
    void
    Destroys the countdown latch.
    long
    Returns the current count.
    int
    Return the number of threads waiting on this countdown latch.
    Returns a string identifying this latch, as well as its state.

    Methods inherited from interface com.vmware.gemfire.distributedtypes.DType

    getName
  • Method Details

    • await

      void await()
      Causes the current thread to wait until the latch has counted down to zero, unless the thread is interrupted.

      If another thread destroys the latch, the awaiting thread will throw a DTypeException.

    • await

      boolean await(long timeout, TimeUnit unit) throws InterruptedException
      Causes the current thread to wait until the latch has counted down to zero, unless the thread is interrupted, or the specified waiting time has elapsed.

      If another thread destroys the latch, the awaiting thread will throw a DTypeException.

      Parameters:
      timeout - the maximum time to wait
      unit - the time unit of the timeout argument
      Returns:
      true if the count reached zero and false if the waiting time elapsed before the count reached zero
      Throws:
      InterruptedException - if the current thread is interrupted while waiting
    • countDown

      long countDown()
      Decrements the count of the latch, releasing all waiting threads if the count reaches zero.
      Returns:
      the remaining count of the latch
    • getCount

      long getCount()
      Returns the current count.
      Returns:
      the current count
    • destroy

      void destroy()
      Destroys the countdown latch. This will release any threads that may have been waiting on the latch.
      Specified by:
      destroy in interface DType
    • getWaiters

      int getWaiters()
      Return the number of threads waiting on this countdown latch.
      Returns:
      the number of threads waiting
    • toString

      String toString()
      Returns a string identifying this latch, as well as its state. Note that the backend object is not locked for this call and the results may not be accurate.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the latch