Class SimpleReadWriteLock

java.lang.Object
java.util.concurrent.locks.ReentrantReadWriteLock
org.apache.juneau.internal.SimpleReadWriteLock
All Implemented Interfaces:
Serializable, ReadWriteLock

An extension of ReentrantReadWriteLock with convenience methods for creating auto-closeable locks.
See Also:
  • Field Details

  • Constructor Details

    • SimpleReadWriteLock

      Constructor.
    • SimpleReadWriteLock

      public SimpleReadWriteLock(boolean fair)
      Constructor
      Parameters:
      fair - true if this lock should use a fair ordering policy.
  • Method Details

    • write

      public SimpleLock write()
      Construct a write lock.
      Returns:
      A new closeable write lock.
    • read

      public SimpleLock read()
      Construct a read lock.
      Returns:
      A new closeable read lock.