final Locker localLocker() { SoftReference<Locker> lockerRef = mLocalLockerRef.get(); Locker locker; if (lockerRef == null || (locker = lockerRef.get()) == null) { mLocalLockerRef.set(new SoftReference<>(locker = new Locker(this))); } return locker; }
final Locker localLocker() { SoftReference<Locker> lockerRef = mLocalLockerRef.get(); Locker locker; if (lockerRef == null || (locker = lockerRef.get()) == null) { mLocalLockerRef.set(new SoftReference<>(locker = new Locker(this))); } return locker; }
final Locker localLocker() { SoftReference<Locker> lockerRef = mLocalLockerRef.get(); Locker locker; if (lockerRef == null || (locker = lockerRef.get()) == null) { mLocalLockerRef.set(new SoftReference<>(locker = new Locker(this))); } return locker; }
/** * Interrupts all waiters, and exclusive locks are transferred to hidden * locker. This prevents them from being acquired again. */ final void close() { Locker locker = new Locker(null); for (LockHT ht : mHashTables) { ht.close(locker); } }
/** * Interrupts all waiters, and exclusive locks are transferred to hidden * locker. This prevents them from being acquired again. */ final void close() { Locker locker = new Locker(null); for (LockHT ht : mHashTables) { ht.close(locker); } }
/** * Interrupts all waiters, and exclusive locks are transferred to hidden * locker. This prevents them from being acquired again. */ final void close() { Locker locker = new Locker(null); for (LockHT ht : mHashTables) { ht.close(locker); } }
@Override public boolean store(long indexId, byte[] key, byte[] value) throws IOException { // Must acquire the lock before task is enqueued. Locker locker = new Locker(mDatabase.mLockManager); locker.attach(ATTACHMENT); locker.tryLockUpgradable(indexId, key, INFINITE_TIMEOUT); runTaskAnywhere(new Worker.Task() { public void run() throws IOException { try { Index ix = getIndex(indexId); // Full exclusive lock is required. locker.lockExclusive(indexId, key, INFINITE_TIMEOUT); doStore(Transaction.BOGUS, indexId, key, value); } finally { locker.scopeUnlockAll(); } } }); return true; }
@Override public boolean store(long indexId, byte[] key, byte[] value) throws IOException { Locker locker = new Locker(mDatabase.mLockManager); locker.attach(ATTACHMENT); locker.tryLockUpgradable(indexId, key, INFINITE_TIMEOUT);