merlimat 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_r126260187
 
 

 ##########
 File path: pulsar-client-cpp/lib/HandlerBase.cc
 ##########
 @@ -48,11 +48,13 @@ void HandlerBase::start() {
 }
 
 void HandlerBase::grabCnx() {
+    Lock lock(mutex_);
     if (connection_.lock()) {
+        lock.unlock();
 
 Review comment:
   This unlock is not strictly needed. It will get unlocked anyway on the return
 
----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to