From ed2becd838f1bdbdb68dc1470dbd54c2d0c741d3 Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 19 Oct 2020 16:03:34 +0100 Subject: [PATCH] Improved unmonitoring for nested objects i.e. objects contains objects which should also be unmonitored. --- .../chronicle/hash/impl/stage/entry/SegmentStages.java | 5 ++--- .../java/net/openhft/chronicle/map/VanillaChronicleMap.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/SegmentStages.java b/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/SegmentStages.java index e851f7bcd..6523c7663 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/SegmentStages.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/stage/entry/SegmentStages.java @@ -22,7 +22,7 @@ import net.openhft.chronicle.algo.bytes.Access; import net.openhft.chronicle.bytes.Bytes; import net.openhft.chronicle.bytes.PointerBytesStore; import net.openhft.chronicle.bytes.VanillaBytes; -import net.openhft.chronicle.core.io.ReferenceCounted; +import net.openhft.chronicle.core.io.IOTools; import net.openhft.chronicle.hash.Data; import net.openhft.chronicle.hash.SegmentLock; import net.openhft.chronicle.hash.impl.*; @@ -43,7 +43,6 @@ import java.util.Objects; import static net.openhft.chronicle.algo.MemoryUnit.BITS; import static net.openhft.chronicle.algo.MemoryUnit.LONGS; import static net.openhft.chronicle.algo.bitset.BitSetFrame.NOT_FOUND; -import static net.openhft.chronicle.core.io.AbstractReferenceCounted.unmonitor; import static net.openhft.chronicle.hash.impl.LocalLockState.UNLOCKED; import static net.openhft.chronicle.hash.impl.VanillaChronicleHash.TIER_COUNTERS_AREA_SIZE; @@ -116,7 +115,7 @@ public abstract class SegmentStages implements SegmentLock, LocksInterface { @NotNull private static VanillaBytes unmonitoredVanillaBytes(PointerBytesStore segmentBS) { VanillaBytes bytes = new VanillaBytes(segmentBS); - unmonitor(bytes); + IOTools.unmonitor(bytes); return bytes; } diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 7e8ca65bf..f92ac0f11 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -22,7 +22,7 @@ import net.openhft.chronicle.bytes.Bytes; import net.openhft.chronicle.bytes.BytesStore; import net.openhft.chronicle.bytes.PointerBytesStore; import net.openhft.chronicle.core.Jvm; -import net.openhft.chronicle.core.io.AbstractReferenceCounted; +import net.openhft.chronicle.core.io.IOTools; import net.openhft.chronicle.hash.ChronicleHashClosedException; import net.openhft.chronicle.hash.ChronicleHashCorruption; import net.openhft.chronicle.hash.Data; @@ -419,7 +419,7 @@ public class VanillaChronicleMap ChainingInterface newQueryContext() { CompiledMapQueryContext context = new CompiledMapQueryContext<>(this); - AbstractReferenceCounted.unmonitor(context.segmentBytes); + IOTools.unmonitor(context.segmentBytes); return context; }