mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
More correctly formulated reasoning of loadFence() in ThreadLocalState.unlockContextLocally()
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user