@Override public LockResult touch(Transaction txn, byte[] key) throws LockFailureException { LocalTransaction local = check(txn); LockMode mode; if (local == null || (mode = local.lockMode()) == LockMode.READ_COMMITTED) { int hash = LockManager.hash(mId, key); if (!isLockAvailable(local, key, hash)) { // Acquire and release. if (local == null) { lockSharedLocal(key, hash).unlock(); } else { LockResult result = local.lock(0, mId, key, hash, local.mLockTimeoutNanos); if (result == LockResult.ACQUIRED) { local.unlock(); } } } } else if (!mode.noReadLock) { int hash = LockManager.hash(mId, key); return local.lock(mode.repeatable, mId, key, hash, local.mLockTimeoutNanos); } return LockResult.UNOWNED; }
result = txn.lock(lockType, mTree.mId, mKey, keyHash, txn.mLockTimeoutNanos);
result = txn.lock(lockType, mTree.mId, mKey, keyHash, txn.mLockTimeoutNanos);
result = txn.lock(lockType, mTree.mId, mKey, keyHash, txn.mLockTimeoutNanos);
result = txn.lock (mode.repeatable, mTree.mId, key, keyHash, txn.mLockTimeoutNanos); locker = null;
result = txn.lock (mode.repeatable, mTree.mId, key, keyHash, txn.mLockTimeoutNanos); locker = null;
result = txn.lock (mode.repeatable, mTree.mId, key, keyHash, txn.mLockTimeoutNanos); locker = null;
locker = txn; } else { result = txn.lock (mode.repeatable, mTree.mId, key, keyHash, txn.mLockTimeoutNanos); if (result != LockResult.ACQUIRED) {
locker = txn; } else { result = txn.lock (mode.repeatable, mTree.mId, key, keyHash, txn.mLockTimeoutNanos); if (result != LockResult.ACQUIRED) {
result = txn.lock (mode.repeatable, mTree.mId, key, keyHash, txn.mLockTimeoutNanos); locker = null;
locker = txn; } else { result = txn.lock (mode.repeatable, mTree.mId, key, keyHash, txn.mLockTimeoutNanos); if (result != LockResult.ACQUIRED) {
if (lockType != 0) { int hash = LockManager.hash(mId, key); local.lock(lockType, mId, key, hash, local.mLockTimeoutNanos);
if (lockType != 0) { int hash = LockManager.hash(mId, key); local.lock(lockType, mId, key, hash, local.mLockTimeoutNanos);
if (lockType != 0) { int hash = LockManager.hash(mId, key); local.lock(lockType, mId, key, hash, local.mLockTimeoutNanos);
if (lockType != 0) { int hash = LockManager.hash(mId, key); local.lock(lockType, mId, key, hash, local.mLockTimeoutNanos);