More correctly formulated reasoning of loadFence() in ThreadLocalState.unlockContextLocally()

This commit is contained in:
leventov
2016-10-01 22:06:14 +03:00
parent 223b2d4329
commit 1825fc61ee
@@ -75,7 +75,7 @@ public abstract class ThreadLocalState {
public void unlockContextLocally() {
// Ensure all reads from mapped memory are done before thread calling chronicleMap.close()
// frees resources potentially nulling some pointer used in those reads.
// frees resources potentially unmapping some memory from where those reads are performed.
MEMORY.loadFence();
// Avoid volatile write to avoid expensive store-load barrier
MEMORY.writeOrderedInt(this, CONTEXT_LOCK_OFFSET, CONTEXT_UNLOCKED);