You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by gi...@git.apache.org on 2017/07/10 18:06:14 UTC

[GitHub] jai1 commented on a change in pull request #555: CPP Client - Accessing connection_ pointer under a lock

jai1 commented on a change in pull request #555: CPP Client - Accessing connection_ pointer under a lock
URL: https://github.com/apache/incubator-pulsar/pull/555#discussion_r126495141
 
 

 ##########
 File path: pulsar-client-cpp/lib/ConsumerImpl.cc
 ##########
 @@ -581,7 +581,9 @@ void ConsumerImpl::doAcknowledge(const BatchMessageId& messageId, proto::Command
 
 void ConsumerImpl::disconnectConsumer() {
     LOG_DEBUG("Broker notification of Closed consumer: " << consumerId_);
+    Lock lock(mutex_);
 
 Review comment:
   handleCreateConsumer "connection_ = cnx" and disconnectConsumer "connection_.reset()" can happen at the same time on different threads, hence the lock
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services