Class IdentitySharedExclusiveLock.IdentityLock

    • Field Detail

      • exclusive

        private final boolean exclusive
      • valid

        private volatile boolean valid
    • Constructor Detail

      • IdentityLock

        public IdentityLock​(boolean exclusive)
        Construct a new instance.
        Parameters:
        exclusive - true if this lock is exclusive, false if this lock is shared
    • Method Detail

      • release

        public void release()
        Release this lock. Invoking this method has no effect if this lock is invalid.
      • isExclusive

        public boolean isExclusive()
        Determine whether this lock is exclusive or shared.
        Returns:
        true if this lock is exclusive, false if this lock is shared
      • isValid

        public boolean isValid()
        Determine whether this lock is valid. A lock starts out valid and becomes invalid when it is released via release() or close().
        Returns:
        true if this lock is valid, false otherwise