/** * Removes anything found in the async queue for the given region * * @param rvv */ private void clearAsyncQueue(LocalRegion region, boolean needsWriteLock, RegionVersionVector rvv) { DiskRegion dr = region.getDiskRegion(); if (needsWriteLock) { acquireWriteLock(dr); } try { // Now while holding the write lock remove any elements from the queue // for this region. Iterator<Object> it = this.asyncQueue.iterator(); while (it.hasNext()) { Object o = it.next(); if (o instanceof AsyncDiskEntry) { AsyncDiskEntry ade = (AsyncDiskEntry) o; if (shouldClear(region, rvv, ade)) { rmAsyncItem(o); } } } } finally { if (needsWriteLock) { releaseWriteLock(dr); } } }
/** * Removes anything found in the async queue for the given region * * @param rvv */ private void clearAsyncQueue(LocalRegion region, boolean needsWriteLock, RegionVersionVector rvv) { DiskRegion dr = region.getDiskRegion(); if (needsWriteLock) { acquireWriteLock(dr); } try { // Now while holding the write lock remove any elements from the queue // for this region. Iterator<Object> it = this.asyncQueue.iterator(); while (it.hasNext()) { Object o = it.next(); if (o instanceof AsyncDiskEntry) { AsyncDiskEntry ade = (AsyncDiskEntry) o; if (shouldClear(region, rvv, ade)) { rmAsyncItem(o); } } } } finally { if (needsWriteLock) { releaseWriteLock(dr); } } }
} finally { if (gotLock) { releaseWriteLock(dr);
} finally { if (gotLock) { releaseWriteLock(dr);
} finally { if (gotLock) { releaseWriteLock(dr);
} finally { if (gotLock) { releaseWriteLock(dr);