HCOLL-155 added a kvContext.dontPutOnClose(); to imporve performance on aquireUsing(key,value)

This commit is contained in:
Rob Austin
2014-11-04 15:44:48 +00:00
parent 7e1e4b35b8
commit 8e278ae62b
@@ -383,11 +383,15 @@ class VanillaChronicleMap<K, KI, MKI extends MetaBytesInterop<K, KI>,
return this.lookupUsing(key, usingValue, LockType.READ_LOCK);
}
// todo remove
@Override
public V acquireUsing(K key, V usingValue) {
try (Context<K, V> kvContext = lookupUsing(key, usingValue, LockType.WRITE_LOCK)) {
try (WriteContext<K, V> kvContext = lookupUsing(key, usingValue, LockType.WRITE_LOCK)) {
if (!isNativeValueClass)
kvContext.dontPutOnClose();
return kvContext.value();
}
}