rocketmq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ifplu...@apache.org
Subject [rocketmq-client-cpp] 28/29: refactor: lock/unlock in RebalanceImpl
Date Tue, 29 Dec 2020 03:36:45 GMT
This is an automated email from the ASF dual-hosted git repository.

ifplusor pushed a commit to branch re_dev
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git

commit 9a30e84c26d8d9c904a5a8cec348aabaaa5f4dc5
Author: James Yin <ywhjames@hotmail.com>
AuthorDate: Thu Oct 22 14:54:15 2020 +0800

    refactor: lock/unlock in RebalanceImpl
---
 src/consumer/RebalanceImpl.cpp | 4 ++--
 src/consumer/RebalanceImpl.h   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/consumer/RebalanceImpl.cpp b/src/consumer/RebalanceImpl.cpp
index ddb39e8..505ce46 100644
--- a/src/consumer/RebalanceImpl.cpp
+++ b/src/consumer/RebalanceImpl.cpp
@@ -36,7 +36,7 @@ RebalanceImpl::~RebalanceImpl() {
   }
 }
 
-void RebalanceImpl::unlock(MQMessageQueue mq, const bool oneway) {
+void RebalanceImpl::unlock(const MQMessageQueue& mq, const bool oneway) {
   std::unique_ptr<FindBrokerResult> findBrokerResult(
       client_instance_->findBrokerAddressInSubscribe(mq.broker_name(), MASTER_ID, true));
   if (findBrokerResult) {
@@ -119,7 +119,7 @@ std::shared_ptr<BROKER2MQS> RebalanceImpl::buildProcessQueueTableByBrokerName()
   return brokerMqs;
 }
 
-bool RebalanceImpl::lock(MQMessageQueue mq) {
+bool RebalanceImpl::lock(const MQMessageQueue& mq) {
   std::unique_ptr<FindBrokerResult> findBrokerResult(
       client_instance_->findBrokerAddressInSubscribe(mq.broker_name(), MASTER_ID, true));
   if (findBrokerResult) {
diff --git a/src/consumer/RebalanceImpl.h b/src/consumer/RebalanceImpl.h
index 194fd48..a44784e 100755
--- a/src/consumer/RebalanceImpl.h
+++ b/src/consumer/RebalanceImpl.h
@@ -43,10 +43,10 @@ class RebalanceImpl {
                 MQClientInstance* clientInstance);
   virtual ~RebalanceImpl();
 
-  void unlock(MQMessageQueue mq, const bool oneway = false);
+  void unlock(const MQMessageQueue& mq, const bool oneway = false);
   void unlockAll(const bool oneway = false);
 
-  bool lock(MQMessageQueue mq);
+  bool lock(const MQMessageQueue& mq);
   void lockAll();
 
   void doRebalance(const bool isOrder = false);


Mime
View raw message