Class Locking.ClientCondition

  • All Implemented Interfaces:
    java.util.concurrent.locks.Condition
    Enclosing class:
    Locking

    protected class Locking.ClientCondition
    extends java.lang.Object
    implements java.util.concurrent.locks.Condition
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Locking.ClientLock lock  
      protected java.util.concurrent.atomic.AtomicReference<java.lang.Thread> parker
      This is okay only having 1 since a client condition is 1 per lock_name, thread id combination.
      protected java.util.concurrent.atomic.AtomicBoolean signaled  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void await()  
      protected void await​(boolean throwInterrupt)  
      protected long await​(long nanoSeconds)  
      boolean await​(long time, java.util.concurrent.TimeUnit unit)
      Note this wait will only work correctly if the converted value is less than 292 years.
      long awaitNanos​(long nanosTimeout)  
      void awaitUninterruptibly()  
      boolean awaitUntil​(java.util.Date deadline)  
      void signal()  
      void signalAll()  
      protected void signaled()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • signaled

        protected final java.util.concurrent.atomic.AtomicBoolean signaled
      • parker

        protected volatile java.util.concurrent.atomic.AtomicReference<java.lang.Thread> parker
        This is okay only having 1 since a client condition is 1 per lock_name, thread id combination.
    • Method Detail

      • await

        public void await()
                   throws java.lang.InterruptedException
        Specified by:
        await in interface java.util.concurrent.locks.Condition
        Throws:
        java.lang.InterruptedException
      • awaitUninterruptibly

        public void awaitUninterruptibly()
        Specified by:
        awaitUninterruptibly in interface java.util.concurrent.locks.Condition
      • awaitNanos

        public long awaitNanos​(long nanosTimeout)
                        throws java.lang.InterruptedException
        Specified by:
        awaitNanos in interface java.util.concurrent.locks.Condition
        Throws:
        java.lang.InterruptedException
      • await

        public boolean await​(long time,
                             java.util.concurrent.TimeUnit unit)
                      throws java.lang.InterruptedException
        Note this wait will only work correctly if the converted value is less than 292 years. This is due to the limitation in System.nano and long values that can only store up to 292 years (2263 nanoseconds). For more information please see System.nanoTime()
        Specified by:
        await in interface java.util.concurrent.locks.Condition
        Throws:
        java.lang.InterruptedException
      • awaitUntil

        public boolean awaitUntil​(java.util.Date deadline)
                           throws java.lang.InterruptedException
        Specified by:
        awaitUntil in interface java.util.concurrent.locks.Condition
        Throws:
        java.lang.InterruptedException
      • await

        protected void await​(boolean throwInterrupt)
                      throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • await

        protected long await​(long nanoSeconds)
                      throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • signal

        public void signal()
        Specified by:
        signal in interface java.util.concurrent.locks.Condition
      • signalAll

        public void signalAll()
        Specified by:
        signalAll in interface java.util.concurrent.locks.Condition
      • signaled

        protected void signaled()