diff --git a/hazelcast/src/hazelcast/client/spi/PartitionService.cpp b/hazelcast/src/hazelcast/client/spi/PartitionService.cpp index f2e1a4bfba..eff549021d 100644 --- a/hazelcast/src/hazelcast/client/spi/PartitionService.cpp +++ b/hazelcast/src/hazelcast/client/spi/PartitionService.cpp @@ -52,7 +52,8 @@ namespace hazelcast { } void PartitionService::shutdown() { - util::LockGuard lg(lock); + // Do not take the lock here since it may be needed by the partition listener thread to cancel and + // the join to succeed and if the lock is already taken it causes a deadlock. if (partitionListenerThread.get() != NULL) { partitionListenerThread->cancel(); partitionListenerThread->join();