/** * Acquire shared lock. */ @Override public boolean tryLock() { return tryAcquireShared() != null; }
/** * Acquire shared lock. */ @Override public boolean tryLock() { return tryAcquireShared() != null; }
/** * Acquire shared lock. */ @Override public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { return tryAcquireShared(time, unit) != null; }
/** * Acquire shared lock. */ @Override public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { return tryAcquireShared(time, unit) != null; }
/** * Acquire shared lock. */ @Override public boolean tryLock(long time, TimeUnit unit) throws InterruptedException { return tryAcquireShared(time, unit) != null; }
/** * Acquire shared lock. */ @Override public boolean tryLock() { return tryAcquireShared() != null; }
/** * Safely acquire shared commit lock while node latch is held exclusively. Latch might need * to be released and relatched in order to obtain shared commit lock without deadlocking. * As a result, the caller must not rely on any existing node reference. It must be * accessed again from the leaf frame instance. * * @param leaf leaf frame, latched exclusively, which might be released and relatched * @return held commitLock */ final CommitLock.Shared commitLock(final CursorFrame leaf) { CommitLock commitLock = mTree.mDatabase.commitLock(); CommitLock.Shared shared = commitLock.tryAcquireShared(); if (shared == null) { leaf.mNode.releaseExclusive(); shared = commitLock.acquireShared(); leaf.acquireExclusive(); } return shared; }
/** * Safely acquire shared commit lock while node latch is held exclusively. Latch might need * to be released and relatched in order to obtain shared commit lock without deadlocking. * As a result, the caller must not rely on any existing node reference. It must be * accessed again from the leaf frame instance. * * @param leaf leaf frame, latched exclusively, which might be released and relatched * @return held commitLock */ final CommitLock.Shared commitLock(final _CursorFrame leaf) { CommitLock commitLock = mTree.mDatabase.commitLock(); CommitLock.Shared shared = commitLock.tryAcquireShared(); if (shared == null) { leaf.mNode.releaseExclusive(); shared = commitLock.acquireShared(); leaf.acquireExclusive(); } return shared; }
/** * Safely acquire shared commit lock while node latch is held exclusively. Latch might need * to be released and relatched in order to obtain shared commit lock without deadlocking. * As a result, the caller must not rely on any existing node reference. It must be * accessed again from the leaf frame instance. * * @param leaf leaf frame, latched exclusively, which might be released and relatched * @return held commitLock */ final CommitLock.Shared commitLock(final _CursorFrame leaf) { CommitLock commitLock = mTree.mDatabase.commitLock(); CommitLock.Shared shared = commitLock.tryAcquireShared(); if (shared == null) { leaf.mNode.releaseExclusive(); shared = commitLock.acquireShared(); leaf.acquireExclusive(); } return shared; }
/** * Safely acquire shared commit lock while node latch is held exclusively. Latch might need * to be released and relatched in order to obtain shared commit lock without deadlocking. * As a result, the caller must not rely on any existing node reference. It must be * accessed again from the leaf frame instance. * * @param leaf leaf frame, latched exclusively, which might be released and relatched * @return held commitLock */ final CommitLock.Shared commitLock(final CursorFrame leaf) { CommitLock commitLock = mTree.mDatabase.commitLock(); CommitLock.Shared shared = commitLock.tryAcquireShared(); if (shared == null) { leaf.mNode.releaseExclusive(); shared = commitLock.acquireShared(); leaf.acquireExclusive(); } return shared; }
/** * With leaf frame held exclusively, acquires the shared commit lock, and prepares the * frame for a store operation (not split, dirty). Leaf latch might be released and * re-acquired by this method. * * @param leaf non-null leaf frame, held exclusively, released if an exception is thrown * @return held commitLock */ private CommitLock.Shared prepareStore(_CursorFrame leaf) throws IOException { CommitLock commitLock = mTree.mDatabase.commitLock(); CommitLock.Shared shared = commitLock.tryAcquireShared(); if (shared == null) { leaf.mNode.releaseExclusive(); shared = commitLock.acquireShared(); leaf.acquireExclusive(); } try { // Releases leaf latch if an exception is thrown. notSplitDirty(leaf); } catch (Throwable e) { shared.release(); throw e; } return shared; }
/** * With leaf frame held exclusively, acquires the shared commit lock, and prepares the * frame for a store operation (not split, dirty). Leaf latch might be released and * re-acquired by this method. * * @param leaf non-null leaf frame, held exclusively, released if an exception is thrown * @return held commitLock */ private CommitLock.Shared prepareStore(CursorFrame leaf) throws IOException { CommitLock commitLock = mTree.mDatabase.commitLock(); CommitLock.Shared shared = commitLock.tryAcquireShared(); if (shared == null) { leaf.mNode.releaseExclusive(); shared = commitLock.acquireShared(); leaf.acquireExclusive(); } try { // Releases leaf latch if an exception is thrown. notSplitDirty(leaf); } catch (Throwable e) { shared.release(); throw e; } return shared; }
CommitLock.Shared shared = commitLock.tryAcquireShared(); try { if (shared == null || !node.tryUpgrade()) {
CommitLock.Shared shared = commitLock.tryAcquireShared(); try { if (shared == null || !node.tryUpgrade()) {
CommitLock.Shared shared = commitLock.tryAcquireShared(); try { if (shared == null || !node.tryUpgrade()) {
CommitLock.Shared shared = commitLock.tryAcquireShared(); try { if (shared == null || !node.tryUpgrade()) {
CommitLock.Shared shared = commitLock.tryAcquireShared(); try { if (shared == null || !node.tryUpgrade()) {
CommitLock.Shared shared = commitLock.tryAcquireShared(); try { if (shared == null || !node.tryUpgrade()) {
CommitLock.Shared shared = commitLock.tryAcquireShared();
CommitLock.Shared shared = commitLock.tryAcquireShared();