From d531c5102198bc8f325c621a964967b6203b024b Mon Sep 17 00:00:00 2001 From: Peter Lawrey Date: Mon, 27 Oct 2014 10:04:14 +0000 Subject: [PATCH] Checkin point --- .../net/openhft/chronicle/map/VanillaChronicleMap.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 60db05846..2af133532 100644 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -562,7 +562,7 @@ class VanillaChronicleMap, long start = bytes.startAddr() + SEGMENT_HEADER; createHashLookups(start); start += align64(sizeOfMultiMap() + sizeOfMultiMapBitSet()) * multiMapsPerSegment(); - final NativeBytes bsBytes = new NativeBytes(tmpBytes.objectSerializer(), + final NativeBytes bsBytes = new NativeBytes(ms.objectSerializer(), start, start + ((entriesPerSegment + 7) / 8), null); freeList = new SingleThreadedDirectBitSet(bsBytes); start += numberOfBitSets() * sizeOfBitSets(); @@ -631,7 +631,7 @@ class VanillaChronicleMap, public void readLock() throws IllegalStateException { while (true) { - final boolean success = bytes.tryRWReadLock(LOCK_OFFSET, lockTimeOutNS); + final boolean success = bytes.tryLockNanosLong(LOCK_OFFSET, lockTimeOutNS); if (success) return; if (currentThread().isInterrupted()) { throw new IllegalStateException(new InterruptedException("Unable to obtain lock, interrupted")); @@ -644,7 +644,7 @@ class VanillaChronicleMap, public void writeLock() throws IllegalStateException { while (true) { - final boolean success = bytes.tryRWWriteLock(LOCK_OFFSET, lockTimeOutNS); + final boolean success = bytes.tryLockNanosLong(LOCK_OFFSET, lockTimeOutNS); if (success) return; if (currentThread().isInterrupted()) { throw new IllegalStateException(new InterruptedException("Unable to obtain lock, interrupted")); @@ -657,7 +657,7 @@ class VanillaChronicleMap, public void readUnlock() { try { - bytes.unlockRWReadLock(LOCK_OFFSET); + bytes.unlockLong(LOCK_OFFSET); } catch (IllegalMonitorStateException e) { errorListener.errorOnUnlock(e); } @@ -665,7 +665,7 @@ class VanillaChronicleMap, public void writeUnlock() { try { - bytes.unlockRWWriteLock(LOCK_OFFSET); + bytes.unlockLong(LOCK_OFFSET); } catch (IllegalMonitorStateException e) { errorListener.errorOnUnlock(e); }