Ejemplo n.º 1
0
 /** Acquires read lock on the given key. */
 protected final void lockForReading(L key) {
   locks.acquireLock(key, false);
 }
Ejemplo n.º 2
0
 /** Upgrades a read lock to a write lock. */
 protected final void upgradeLock(L key) {
   locks.upgradeLock(key);
 }
Ejemplo n.º 3
0
 /** Release the locks (either read or write). */
 protected final void unlock(L key) {
   locks.releaseLock(key);
 }
Ejemplo n.º 4
0
 /** Acquires write lock on the given key. */
 protected final void lockForWriting(L key) {
   locks.acquireLock(key, true);
 }
Ejemplo n.º 5
0
 public int getTotalLockCount() {
   return locks.getTotalLockCount();
 }
Ejemplo n.º 6
0
 /** Based on the supplied param, releases a global read(false) or write (true) lock. */
 protected final void releaseGlobalLock(boolean exclusive) {
   locks.releaseGlobalLock(exclusive);
 }
Ejemplo n.º 7
0
 /** 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);
 }
Ejemplo n.º 8
0
 /** Same as {@link #lockForWriting(Object)}, but with 0 timeout. */
 protected final boolean immediateLockForWriting(L key) {
   return locks.acquireLock(key, true, 0);
 }
Ejemplo n.º 9
0
 /** Downgrade a write lock to a read lock */
 protected final void downgradeLock(L key) {
   locks.downgradeLock(key);
 }