BewareMyPower commented on code in PR #131:
URL: https://github.com/apache/pulsar-client-cpp/pull/131#discussion_r1036660115


##########
lib/ProducerImpl.cc:
##########
@@ -694,6 +705,8 @@ void ProducerImpl::closeAsync(CloseCallback 
originalCallback) {
         }
     };
 
+    Lock lock(mutex_);

Review Comment:
   For example, if someone wanted to remove the unnecessary mutex uses in 
future, the mutex here would be likely to be removed because the state is 
atomic, and the following code like cancelling the timers and failing the 
pending messages doesn't require a lock.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to