BewareMyPower commented on a change in pull request #10036:
URL: https://github.com/apache/pulsar/pull/10036#discussion_r601945512



##########
File path: pulsar-client-cpp/lib/ConsumerImpl.cc
##########
@@ -752,20 +746,13 @@ Optional<MessageId> ConsumerImpl::clearReceiveQueue() {
     }
 }
 
-void ConsumerImpl::increaseAvailablePermits(const ClientConnectionPtr& 
currentCnx, int numberOfPermits) {
-    int additionalPermits = 0;
+void ConsumerImpl::increaseAvailablePermits(const ClientConnectionPtr& 
currentCnx, int delta) {
+    int newAvailablePermits = addAndGet(availablePermits_, delta);

Review comment:
       I changed the code here. But I didn't specify the relaxed order. Could 
you explain if the relax order is enough here? If yes, how should I specify the 
memory order in followed `compare_exchange_weak`?




-- 
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:
[email protected]


Reply via email to