Class NoOpLock

  • All Implemented Interfaces:
    java.util.concurrent.locks.Lock

    public final class NoOpLock
    extends java.lang.Object
    implements java.util.concurrent.locks.Lock
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static NoOpLock INSTANCE  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private NoOpLock()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void lock()  
      void lockInterruptibly()  
      java.util.concurrent.locks.Condition newCondition()  
      boolean tryLock()  
      boolean tryLock​(long l, java.util.concurrent.TimeUnit tu)  
      void unlock()  
      • Methods inherited from class java.lang.Object

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

      • INSTANCE

        public static final NoOpLock INSTANCE
    • Constructor Detail

      • NoOpLock

        private NoOpLock()
    • Method Detail

      • lock

        public void lock()
        Specified by:
        lock in interface java.util.concurrent.locks.Lock
      • lockInterruptibly

        public void lockInterruptibly()
                               throws java.lang.InterruptedException
        Specified by:
        lockInterruptibly in interface java.util.concurrent.locks.Lock
        Throws:
        java.lang.InterruptedException
      • tryLock

        public boolean tryLock()
        Specified by:
        tryLock in interface java.util.concurrent.locks.Lock
      • tryLock

        public boolean tryLock​(long l,
                               java.util.concurrent.TimeUnit tu)
                        throws java.lang.InterruptedException
        Specified by:
        tryLock in interface java.util.concurrent.locks.Lock
        Throws:
        java.lang.InterruptedException
      • unlock

        public void unlock()
        Specified by:
        unlock in interface java.util.concurrent.locks.Lock
      • newCondition

        public java.util.concurrent.locks.Condition newCondition()
        Specified by:
        newCondition in interface java.util.concurrent.locks.Lock