jai1 commented on a change in pull request #577: CPP add receiveAsync API
URL: https://github.com/apache/incubator-pulsar/pull/577#discussion_r128684159
 
 

 ##########
 File path: pulsar-client-cpp/lib/PartitionedConsumerImpl.h
 ##########
 @@ -79,6 +80,7 @@ namespace pulsar {
         typedef std::vector<ConsumerImplPtr> ConsumerList;
         ConsumerList consumers_;
         boost::mutex mutex_;
+        boost::mutex pendingReceiveMutex_;
 
 Review comment:
   Agreed, but the problem is that in PartitionedConsumerImpl:receive we should 
have released the lock after we checked the state_ and messageListener_ 
condition since the other data structures are thread safe (see 
ConsumerImpl::receiveHelper to understand my point)
   
   If you fix this locking then you won't require pendingReceiveMutex_
   
   I am stressing about this minor thing because in all classes we have only 
one lock to protect all members (mutex_), so as far as possible I don't want to 
break this convention.
 
----------------------------------------------------------------
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