You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/03/20 18:20:32 UTC

[GitHub] [pulsar] lovelle commented on a change in pull request #3863: [cpp client] implement reference count for close()

lovelle commented on a change in pull request #3863: [cpp client] implement reference count for close()
URL: https://github.com/apache/pulsar/pull/3863#discussion_r267482489
 
 

 ##########
 File path: pulsar-client-cpp/lib/ConsumerImpl.cc
 ##########
 @@ -110,6 +110,10 @@ Future<Result, ConsumerImplBaseWeakPtr> ConsumerImpl::getConsumerCreatedFuture()
     return consumerCreatedPromise_.getFuture();
 }
 
+void ConsumerImpl::incrRefCount() { ++refCount_; }
+
+bool ConsumerImpl::shouldTearDown() { return refCount_ > 0 ? refCount_-- == 0 : refCount_ == 0; }
 
 Review comment:
   Great! I agree that it should express the fact that is being decremented.
   I did it they way you mention If I understood correctly, please take a look now :+1: 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services