From a3a45e16817bb39a7de48a1c2dc083169476c4ab Mon Sep 17 00:00:00 2001 From: leventov Date: Wed, 19 Aug 2015 23:23:42 +0300 Subject: [PATCH] Optimize BigSegmentHeader.tryWriteLock() --- .../java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java b/src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java index 42ed938aa..67e35bd57 100644 --- a/src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java +++ b/src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java @@ -363,7 +363,7 @@ public final class BigSegmentHeader implements SegmentHeader { @Override public boolean tryWriteLock(long address) { - if (getCountWord(address) == 0 && casCountWord(address, 0, WRITE_LOCKED_COUNT_WORD)) { + if (casCountWord(address, 0, WRITE_LOCKED_COUNT_WORD)) { writeExclusiveLockHolder(address); return true; } else {