Fix a bug in source code & spec -- entry relocation on put() should acquire write lock

This commit is contained in:
leventov
2015-08-02 00:23:39 +03:00
parent 38c1e1c723
commit 0811f98e4c
2 changed files with 78 additions and 0 deletions
@@ -188,6 +188,7 @@ public abstract class MapEntryStages<K, V> extends HashEntryStages<K>
}
protected void relocation(Data<V> newValue, long newSizeOfEverythingBeforeValue) {
s.innerWriteLock.lock();
s.free(pos, entrySizeInChunks);
long entrySize = innerEntrySize(newSizeOfEverythingBeforeValue, newValue.size());
allocatedChunks.initEntryAndKeyCopying(entrySize, valueSizeOffset - keySizeOffset);