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 2021/03/26 01:17:40 UTC
[GitHub] [pulsar] BewareMyPower commented on a change in pull request #10036: [C++] Fix paused zero queue consumer still pre-fetches messages
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:
users@infra.apache.org