Refactor MapQuery.putPrefix() method

This commit is contained in:
leventov
2016-02-17 17:14:39 +07:00
parent 3594027fb5
commit 4b58d21953
2 changed files with 8 additions and 8 deletions
@@ -91,13 +91,14 @@ public abstract class MapQuery<K, V, R> extends HashQuery<K>
protected void putPrefix() {
checkOnEachPublicOperation.checkOnEachPublicOperation();
boolean underUpdatedLockIsHeld = !s.innerUpdateLock.isHeldByCurrentThread();
if (underUpdatedLockIsHeld)
if (!s.innerUpdateLock.isHeldByCurrentThread())
s.innerUpdateLock.lock();
boolean searchResultsNotTrusted = underUpdatedLockIsHeld ||
s.nestedContextsLockedOnSameSegment;
if (hlp.hashLookupPosInit() && ks.searchStateAbsent() && searchResultsNotTrusted)
hlp.closeHashLookupPos();
if (s.nestedContextsLockedOnSameSegment &&
s.rootContextLockedOnThisSegment.latestSameThreadSegmentModCount() !=
s.contextModCount) {
if (hlp.hashLookupPosInit() && ks.searchStateAbsent())
hlp.closeHashLookupPos();
}
}
@Override