From c28030203a9734b96e1e3a7f533641b893bdd0e3 Mon Sep 17 00:00:00 2001 From: ihsan demir Date: Thu, 24 Mar 2016 14:50:54 +0200 Subject: [PATCH 1/2] ByteBuffer offset fix. --- hazelcast/src/hazelcast/util/ByteBuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hazelcast/src/hazelcast/util/ByteBuffer.cpp b/hazelcast/src/hazelcast/util/ByteBuffer.cpp index db77643443..7cdb2e71df 100644 --- a/hazelcast/src/hazelcast/util/ByteBuffer.cpp +++ b/hazelcast/src/hazelcast/util/ByteBuffer.cpp @@ -136,7 +136,7 @@ namespace hazelcast { size_t ByteBuffer::readBytes(byte *target, size_t len) { size_t numBytesToCopy = std::min(lim - pos, len); memcpy(target, ix(), numBytesToCopy); - pos += len; + pos += numBytesToCopy; return numBytesToCopy; } } From 0769d917740ae7c2ec1c176492e1b3c27dc02193 Mon Sep 17 00:00:00 2001 From: ihsan demir Date: Mon, 28 Mar 2016 23:44:13 +0300 Subject: [PATCH 2/2] Wait thread termination on testLatch finish. --- hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp b/hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp index a1fba87ebb..154926d3cc 100644 --- a/hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp +++ b/hazelcast/test/src/countdownlatch/ICountDownLatchTest.cpp @@ -48,6 +48,8 @@ namespace hazelcast { util::Thread t(testLatchThread, l.get()); ASSERT_TRUE(l->await(10 * 1000)); + + t.join(); } }