From 389685a31e4be1528707934702349f85c1cbf76c Mon Sep 17 00:00:00 2001 From: Andras Slemmer Date: Tue, 14 Mar 2017 15:17:06 +0000 Subject: [PATCH] PR 339 Address comments --- .../corda/node/services/messaging/CordaRPCClientImpl.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/node/src/main/kotlin/net/corda/node/services/messaging/CordaRPCClientImpl.kt b/node/src/main/kotlin/net/corda/node/services/messaging/CordaRPCClientImpl.kt index b46dad17ac..9afacf8ebd 100644 --- a/node/src/main/kotlin/net/corda/node/services/messaging/CordaRPCClientImpl.kt +++ b/node/src/main/kotlin/net/corda/node/services/messaging/CordaRPCClientImpl.kt @@ -284,11 +284,8 @@ class CordaRPCClientImpl(private val session: ClientSession, private val rootShared = root.doOnUnsubscribe { close() }.share() // This could be made more efficient by using a specialised IntMap - /** - * When handling this map we synchronise on it explicitly instead of on [this], otherwise there is a race - * condition between close() and deliver() - */ - private val observables = HashMap>() + // When handling this map we don't synchronise on [this], otherwise there is a race condition between close() and deliver() + private val observables = Collections.synchronizedMap(HashMap>()) private var consumer: ClientConsumer? = null