mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Refactor MapQuery.putPrefix() method
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user