Interface DCountDownLatch

  • All Superinterfaces:
    DType

    public interface DCountDownLatch
    extends DType
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void await()
      Causes the current thread to wait until the latch has counted down to zero, unless the thread is interrupted.
      boolean await​(long timeout, java.util.concurrent.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 countDown()
      Decrements the count of the latch, releasing all waiting threads if the count reaches zero.
      void destroy()
      Destroys the countdown latch.
      long getCount()
      Returns the current count.
      int getWaiters()
      Return the number of threads waiting on this countdown latch.
      java.lang.String toString()
      Returns a string identifying this latch, as well as its state.
      • Methods inherited from interface dev.gemfire.dtype.DType

        getName
    • Method Detail

      • 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,
                      java.util.concurrent.TimeUnit unit)
               throws java.lang.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:
        java.lang.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

        java.lang.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 java.lang.Object
        Returns:
        a string representation of the latch