return findOwnerAttachment(null, lockType); } finally { ht.releaseShared();
return findOwnerAttachment(null, lockType); } finally { ht.releaseShared();
return findOwnerAttachment(null, lockType, hash); } finally { ht.releaseShared();
/** * Returns true if a shared lock can be granted for the given key. Caller must hold the * node latch which contains the key. * * @param locker optional locker */ boolean isAvailable(_LockOwner locker, long indexId, byte[] key, int hash) { // Optimistically find the lock. int stamp = mStamp; if (stamp >= 0) { _Lock lock = lockFor(indexId, key, hash); if (lock != null) { return lock.isAvailable(locker); } if (stamp == mStamp) { return true; } } _Lock lock; acquireShared(); try { lock = lockFor(indexId, key, hash); } finally { releaseShared(); } return lock == null ? true : lock.isAvailable(locker); }
/** * Returns true if a shared lock can be granted for the given key. Caller must hold the * node latch which contains the key. * * @param locker optional locker */ boolean isAvailable(_LockOwner locker, long indexId, byte[] key, int hash) { // Optimistically find the lock. int stamp = mStamp; if (stamp >= 0) { _Lock lock = lockFor(indexId, key, hash); if (lock != null) { return lock.isAvailable(locker); } if (stamp == mStamp) { return true; } } _Lock lock; acquireShared(); try { lock = lockFor(indexId, key, hash); } finally { releaseShared(); } return lock == null ? true : lock.isAvailable(locker); }
int size() { acquireShared(); int size = mSize; releaseShared(); return size; }
final LockResult check(_LockOwner locker, long indexId, byte[] key, int hash) { LockHT ht = getLockHT(hash); ht.acquireShared(); try { _Lock lock = ht.lockFor(indexId, key, hash); return lock == null ? LockResult.UNOWNED : lock.check(locker); } finally { ht.releaseShared(); } }
final LockResult check(_LockOwner locker, long indexId, byte[] key, int hash) { LockHT ht = getLockHT(hash); ht.acquireShared(); try { _Lock lock = ht.lockFor(indexId, key, hash); return lock == null ? LockResult.UNOWNED : lock.check(locker); } finally { ht.releaseShared(); } }
final LockResult check(_LockOwner locker, long indexId, byte[] key, int hash) { LockHT ht = getLockHT(hash); ht.acquireShared(); try { _Lock lock = ht.lockFor(indexId, key, hash); return lock == null ? LockResult.UNOWNED : lock.check(locker); } finally { ht.releaseShared(); } }
int size() { acquireShared(); int size = mSize; releaseShared(); return size; }
int size() { acquireShared(); int size = mSize; releaseShared(); return size; }