@Override public void commit(byte[] value) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); try { final _LocalTransaction txn = mTxn; if (txn == null) { final _Locker locker = mTree.lockExclusiveLocal(key, keyHash()); try { store(txn, leafExclusive(), value); } finally { locker.unlock(); } } else { doCommit(false, txn, key, value); } } catch (Throwable e) { throw handleException(e, false); } }
@Override public void commit(byte[] value) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); try { final _LocalTransaction txn = mTxn; if (txn == null) { final _Locker locker = mTree.lockExclusiveLocal(key, keyHash()); try { store(txn, leafExclusive(), value); } finally { locker.unlock(); } } else { doCommit(txn, key, value); } } catch (Throwable e) { throw handleException(e, false); } }
return doFindAndStore(txn, key, value); } finally { locker.unlock();
return doFindAndStore(txn, key, value); } finally { locker.unlock();
@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; }
locker.unlock();
@Override public void store(byte[] value) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); try { final _LocalTransaction txn = mTxn; if (txn == null) { final _Locker locker = mTree.lockExclusiveLocal(key, keyHash()); try { store(txn, leafExclusive(), value); } finally { locker.unlock(); } } else { if (txn.lockMode() != LockMode.UNSAFE) { txn.lockExclusive(mTree.mId, key, keyHash()); } store(txn, leafExclusive(), value); } } catch (Throwable e) { throw handleException(e, false); } }
@Override public void store(byte[] value) throws IOException { byte[] key = mKey; ViewUtils.positionCheck(key); try { final _LocalTransaction txn = mTxn; if (txn == null) { final _Locker locker = mTree.lockExclusiveLocal(key, keyHash()); try { store(txn, leafExclusive(), value); } finally { locker.unlock(); } } else { if (txn.lockMode() != LockMode.UNSAFE) { txn.lockExclusive(mTree.mId, key, keyHash()); } store(txn, leafExclusive(), value); } } catch (Throwable e) { throw handleException(e, false); } }
locker.unlock();
locker.unlock();
name = mRegistryKeyMap.load(Transaction.BOGUS, idKey); } finally { locker.unlock();
name = mRegistryKeyMap.load(Transaction.BOGUS, idKey); } finally { locker.unlock();
storeAndRedo(txn, value); } finally { locker.unlock();
} finally { if (locker != null) { locker.unlock();
} finally { if (locker != null) { locker.unlock();
return doFindAndModify(null, key, oldValue, newValue); } finally { locker.unlock();
} finally { if (locker != null) { locker.unlock();
} finally { if (locker != null) { locker.unlock();
} finally { if (locker != null) { locker.unlock();
return doFindAndStore(txn, key, value); } finally { locker.unlock();