public DLockGrantor getGrantor() { Assert.assertHoldsLock(this.destroyLock,false); synchronized (this.lockGrantorIdLock) { return this.grantor; } }
public DLockGrantor getGrantor() { Assert.assertHoldsLock(this.destroyLock,false); synchronized (this.lockGrantorIdLock) { return this.grantor; } }
/** * Returns true if locking has been suspended. * <p> * Caller must synchronize on suspendLock. * * @return true if locking has been suspended * @guarded.By {@link #suspendLock} */ protected boolean isLockingSuspended() { if (DEBUG_SUSPEND_LOCK) { Assert.assertHoldsLock(this.suspendLock,true); } return this.lockingSuspendedBy != null; }
private void basicRemoveIndex(int index) { Assert.assertHoldsLock(this,true); // minimize volatile reads by copying ref to local var Profile[] oldProfiles = this.profiles; // volatile read Profile[] newProfiles = new Profile[oldProfiles.length - 1]; System.arraycopy(oldProfiles, 0, newProfiles, 0, index); System.arraycopy(oldProfiles, index + 1, newProfiles, index, newProfiles.length - index); this.profiles = newProfiles; // volatile write if (this.numActiveProfiles > 0) { this.numActiveProfiles--; } }
private void basicRemoveIndex(int index) { Assert.assertHoldsLock(this,true); // minimize volatile reads by copying ref to local var Profile[] oldProfiles = this.profiles; // volatile read Profile[] newProfiles = new Profile[oldProfiles.length - 1]; System.arraycopy(oldProfiles, 0, newProfiles, 0, index); System.arraycopy(oldProfiles, index + 1, newProfiles, index, newProfiles.length - index); this.profiles = newProfiles; // volatile write if (this.numActiveProfiles > 0) { this.numActiveProfiles--; } }
/** * Returns true if {@link #lockGrantorId} is the same as the specified * LockGrantorId. Caller must synchronize on {@link #lockGrantorIdLock}. * * @param someLockGrantorId the LockGrantorId to check */ private boolean checkLockGrantorId(LockGrantorId someLockGrantorId) { Assert.assertHoldsLock(this.lockGrantorIdLock,true); if (this.lockGrantorId == null) { return false; } return this.lockGrantorId.sameAs(someLockGrantorId); }
/** * Returns true if {@link #lockGrantorId} is the same as the specified * LockGrantorId. Caller must synchronize on {@link #lockGrantorIdLock}. * * @param someLockGrantorId the LockGrantorId to check */ private boolean checkLockGrantorId(LockGrantorId someLockGrantorId) { Assert.assertHoldsLock(this.lockGrantorIdLock,true); if (this.lockGrantorId == null) { return false; } return this.lockGrantorId.sameAs(someLockGrantorId); }
/** * Returns true if <code>someLockGrantor</code> equals the current * {@link #lockGrantorId}. * * @param someLockGrantor * @return true if someLockGrantor equals the current lockGrantorId */ private boolean equalsLockGrantorId(LockGrantorId someLockGrantor) { Assert.assertHoldsLock(this.lockGrantorIdLock,true); if (someLockGrantor == null) { return this.lockGrantorId == null; } return someLockGrantor.equals(this.lockGrantorId); }
protected boolean isCurrentlyOrIsMakingLockGrantor() { Assert.assertHoldsLock(this.destroyLock,false); synchronized (this.lockGrantorIdLock) { return this.lockGrantorId != null && this.lockGrantorId.isLocal(getSerialNumber()); } }
/** exchange profiles to initialize this advisor */ private void exchangeProfiles() { Assert.assertHoldsLock(this,false); // causes deadlock Assert.assertHoldsLock(this.initializeLock,true); new UpdateAttributesProcessor(getAdvisee()).distribute(true); setInitialized(); }
boolean isCurrentlyOrIsMakingLockGrantor() { Assert.assertHoldsLock(this.destroyLock,false); synchronized (this.lockGrantorIdLock) { return this.lockGrantorId != null && this.lockGrantorId.isLocal(getSerialNumber()); } }
protected int indexOfMemberId(ProfileId id) { Assert.assertHoldsLock(this,true); Profile[] profs = this.profiles; // volatile read for (int i = 0; i < profs.length; i++) { Profile p = profs[i]; if (id instanceof InternalDistributedMember) { if (p.getDistributedMember().equals(id)) return i; } else { if (p.getId().equals(id)) return i; } } return -1; }
protected int indexOfMemberId(ProfileId id) { Assert.assertHoldsLock(this,true); Profile[] profs = this.profiles; // volatile read for (int i = 0; i < profs.length; i++) { Profile p = profs[i]; if (id instanceof InternalDistributedMember) { if (p.getDistributedMember().equals(id)) return i; } else { if (p.getId().equals(id)) return i; } } return -1; }
/** exchange profiles to initialize this advisor */ private void exchangeProfiles() { Assert.assertHoldsLock(this,false); // causes deadlock Assert.assertHoldsLock(this.initializeLock,true); DistributionAdvisee advisee = getAdvisee(); new UpdateAttributesProcessor(advisee).distribute(true); setInitialized(); if (advisee instanceof LocalRegion) { ((LocalRegion)advisee).setProfileExchanged(true); } }
boolean isMakingLockGrantor() { Assert.assertHoldsLock(this.destroyLock,false); synchronized (this.lockGrantorIdLock) { return this.lockGrantorId != null && this.lockGrantorId.isLocal(getSerialNumber()) && this.grantor != null && this.grantor.isInitializing(); } }
protected boolean isCurrentlyLockGrantor() { Assert.assertHoldsLock(this.destroyLock,false); synchronized (this.lockGrantorIdLock) { return this.lockGrantorId != null && this.lockGrantorId.isLocal(getSerialNumber()) && this.grantor != null && this.grantor.isReady(); } }
boolean isCurrentlyLockGrantor() { Assert.assertHoldsLock(this.destroyLock,false); synchronized (this.lockGrantorIdLock) { return this.lockGrantorId != null && this.lockGrantorId.isLocal(getSerialNumber()) && this.grantor != null && this.grantor.isReady(); } }
protected boolean isMakingLockGrantor() { Assert.assertHoldsLock(this.destroyLock,false); synchronized (this.lockGrantorIdLock) { return this.lockGrantorId != null && this.lockGrantorId.isLocal(getSerialNumber()) && this.grantor != null && this.grantor.isInitializing(); } }
/** * Early check for resources. This code may be executed for every put operation if * there are no datastores present, limit excessive logging. * @since gemfire5.8 */ private void earlySufficientStoresCheck(String partitionName) { assert Assert.assertHoldsLock(this,false); Set currentStores = getAllStores(partitionName); if (currentStores.isEmpty()) { if (shouldLogInsufficientStores()) { insufficientStores(currentStores, Collections.EMPTY_LIST, true); } insufficientStores(currentStores, Collections.EMPTY_LIST, false); } }
/** * Resume locking after it has been suspended. * <p> * Caller must synchronize on suspendLock. */ private void resumeLocking() { if (DEBUG_SUSPEND_LOCK) { Assert.assertHoldsLock(this.suspendLock,true); } if (getLogWriter().fineEnabled()) { getLogWriter().fine("Resume locking of " + this.dlock); } this.lockingSuspendedBy = null; this.suspendedLockId = INVALID_LOCK_ID; }