/** Acquires read lock on the given key. */ protected final void lockForReading(L key) { locks.acquireLock(key, false); }
/** Upgrades a read lock to a write lock. */ protected final void upgradeLock(L key) { locks.upgradeLock(key); }
/** Release the locks (either read or write). */ protected final void unlock(L key) { locks.releaseLock(key); }
/** Acquires write lock on the given key. */ protected final void lockForWriting(L key) { locks.acquireLock(key, true); }
public int getTotalLockCount() { return locks.getTotalLockCount(); }
/** Based on the supplied param, releases a global read(false) or write (true) lock. */ protected final void releaseGlobalLock(boolean exclusive) { locks.releaseGlobalLock(exclusive); }
/** Based on the supplied param, acquires a global read(false) or write (true) lock. */ protected final boolean acquireGlobalLock(boolean exclusive) { return locks.aquireGlobalLock(exclusive, globalLockTimeoutMillis); }
/** Same as {@link #lockForWriting(Object)}, but with 0 timeout. */ protected final boolean immediateLockForWriting(L key) { return locks.acquireLock(key, true, 0); }
/** Downgrade a write lock to a read lock */ protected final void downgradeLock(L key) { locks.downgradeLock(key); }