LockResult r = tryLockShared(locker); if (r != null) { return r; LockResult r = tryLockShared(locker); if (r != null) { locker.mWaitingFor = null;
LockResult r = tryLockShared(locker); if (r != null) { return r; LockResult r = tryLockShared(locker); if (r != null) { locker.mWaitingFor = null;
LockResult r = tryLockShared(locker); if (r != null) { return r; LockResult r = tryLockShared(locker); if (r != null) { locker.mWaitingFor = null;
/** * Acquire a shared lock, with infinite timeout, but don't push the lock into the owned * lock stack. Returns the lock which was acquired, or null if already owned. */ final _Lock lockSharedNoPush(long indexId, byte[] key) throws LockFailureException { int hash = hash(indexId, key); _LockManager.LockHT ht = mManager.getLockHT(hash); _Lock lock; LockResult result; ht.acquireExclusive(); try { lock = ht.lockAccess(indexId, key, hash); result = lock.tryLockShared(ht, this, -1); } finally { ht.releaseExclusive(); } if (!result.isHeld()) { throw failed(TYPE_SHARED, result, -1); } return result == LockResult.ACQUIRED ? lock : null; }
/** * Acquire a shared lock, with infinite timeout, but don't push the lock into the owned * lock stack. Returns the lock which was acquired, or null if already owned. */ final _Lock lockSharedNoPush(long indexId, byte[] key) throws LockFailureException { int hash = hash(indexId, key); _LockManager.LockHT ht = mManager.getLockHT(hash); _Lock lock; LockResult result; ht.acquireExclusive(); try { lock = ht.lockAccess(indexId, key, hash); result = lock.tryLockShared(ht, this, -1); } finally { ht.releaseExclusive(); } if (!result.isHeld()) { throw failed(TYPE_SHARED, result, -1); } return result == LockResult.ACQUIRED ? lock : null; }
if (lock.matches(indexId, key, hash)) { if (type == TYPE_SHARED) { result = lock.tryLockShared(this, locker, nanosTimeout); break lockNonEx; } else if (type == TYPE_UPGRADABLE) {
if (lock.matches(indexId, key, hash)) { if (type == TYPE_SHARED) { result = lock.tryLockShared(this, locker, nanosTimeout); break lockNonEx; } else if (type == TYPE_UPGRADABLE) {
if (lock.matches(indexId, key, hash)) { if (type == TYPE_SHARED) { result = lock.tryLockShared(this, locker, nanosTimeout); break lockNonEx; } else if (type == TYPE_UPGRADABLE) {