public void acquireWriteLock() throws InterruptedException { this.lock.attemptWriteLock(-1, null); }
/** * An attempt to acquire write lock should succeed when there are no read * locks already taken ({@link #attemptReadLock(long)}). The owner argument is * ignored since this is a non-reentrant lock and the behaviour is identical * to {@link #attemptWriteLock(long)}. * * @param msecs * The timeout to wait for lock acquisition before failing. A value * equal to zero means not to wait at all, while a value less than * zero means to wait indefinitely. * * @return true if lock acquired successfully, false if the attempt timed out */ public final boolean attemptWriteLock(long msecs, Object owner) { return attemptWriteLock(msecs); }
/** * Clear the cache retrieved value for given table. */ public void clearRetrievedValue(Object table) { this.generatedValuesLock.attemptWriteLock(-1); try { this.generatedValues.remove(table); } finally { this.generatedValuesLock.releaseWriteLock(); } }
/** * Clear the cache retrieved value for given table. */ public void clearRetrievedValue(Object table) { this.generatedValuesLock.attemptWriteLock(-1); try { this.generatedValues.remove(table); } finally { this.generatedValuesLock.releaseWriteLock(); } }
/** * Clear the cache retrieved value for given table. */ public void clearRetrievedValue(Object table) { this.generatedValuesLock.attemptWriteLock(-1); try { this.generatedValues.remove(table); } finally { this.generatedValuesLock.releaseWriteLock(); } }
/** * Get the generated IDENTITY value for given table next to the one last * retrieved by this node. Also mark the value to have been read by the new * generating node that is reading this IDENTITY value. */ public long getAfterRetrievedValue(Object table, long start, long increment, DistributedMember idGeneratingNode) { this.generatedValuesLock.attemptWriteLock(-1); try { Object[] id = this.generatedValues.get(table); if (id != null) { AtomicLong currValue = (AtomicLong)id[0]; id[1] = idGeneratingNode; return (currValue.get() + increment); } else { this.generatedValues.put(table, new Object[] { new AtomicLong(start), idGeneratingNode }); return start; } } finally { this.generatedValuesLock.releaseWriteLock(); } }
/** * Get the generated IDENTITY value for given table next to the one last * retrieved by this node. Also mark the value to have been read by the new * generating node that is reading this IDENTITY value. */ public long getAfterRetrievedValue(Object table, long start, long increment, DistributedMember idGeneratingNode) { this.generatedValuesLock.attemptWriteLock(-1); try { Object[] id = this.generatedValues.get(table); if (id != null) { AtomicLong currValue = (AtomicLong)id[0]; id[1] = idGeneratingNode; return (currValue.get() + increment); } else { this.generatedValues.put(table, new Object[] { new AtomicLong(start), idGeneratingNode }); return start; } } finally { this.generatedValuesLock.releaseWriteLock(); } }
/** * Get the generated IDENTITY value for given table next to the one last * retrieved by this node. Also mark the value to have been read by the new * generating node that is reading this IDENTITY value. */ public long getAfterRetrievedValue(Object table, long start, long increment, DistributedMember idGeneratingNode) { this.generatedValuesLock.attemptWriteLock(-1); try { Object[] id = this.generatedValues.get(table); if (id != null) { AtomicLong currValue = (AtomicLong)id[0]; id[1] = idGeneratingNode; return (currValue.get() + increment); } else { this.generatedValues.put(table, new Object[] { new AtomicLong(start), idGeneratingNode }); return start; } } finally { this.generatedValuesLock.releaseWriteLock(); } }
public void close() { this.suspectEntriesLock.attemptWriteLock(-1); try { for (SuspectEntryList l : this.suspectEntries.values()) { for (EntryEventImpl e : l) { e.release(); } } } finally { this.suspectEntriesLock.releaseWriteLock(); } clear(null); }
this.mapLock.attemptWriteLock(-1); try {
this.pendingTXRegionStatesLock.attemptWriteLock(-1); this.pendingTXRegionStatesLockOwner = Thread.currentThread();
final THashMapWithCreate pendingTXRS = this.pendingTXRegionStates; if (pendingTXRS != null) { this.pendingTXRegionStatesLock.attemptWriteLock(-1); try {
public void applyAllSuspects(final LocalRegion owner) { this.suspectEntriesLock.attemptWriteLock(-1); try { while (!this.suspectEntries.isEmpty()) { final LogWriterI18n log = owner.getLogWriterI18n(); if (log.infoEnabled()) { log.info(LocalizedStrings.DEBUG, "applyAllSuspects called for region: " + owner.getName()); } SuspectEntryList list; for (Object key : this.listForKeyOrder) { list = this.suspectEntries.remove(key); applySuspect(key, list, owner, log); } } // test method owner.suspendApplyAllSuspects(); // clear the failed events list owner.getImageState().clearFailedEvents(); this.applyAllSuspectsFinished = true; } finally { this.listForKeyOrder.clear(); this.suspectEntriesLock.releaseWriteLock(); } }
this.listUpdateLock.attemptWriteLock(-1); try { if (p == null) {
this.listUpdateLock.attemptWriteLock(-1); try { if (newFirst != null) {