You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kvrocks.apache.org by ti...@apache.org on 2022/10/12 01:59:57 UTC
[incubator-kvrocks] branch unstable updated: Remove useless parameter in `SlotMigrate::Loop` (#974)
This is an automated email from the ASF dual-hosted git repository.
tison pushed a commit to branch unstable
in repository https://gitbox.apache.org/repos/asf/incubator-kvrocks.git
The following commit(s) were added to refs/heads/unstable by this push:
new e4a6fda Remove useless parameter in `SlotMigrate::Loop` (#974)
e4a6fda is described below
commit e4a6fdae7d91ed7b920b5718d031c57b8dfd242f
Author: Twice <tw...@gmail.com>
AuthorDate: Wed Oct 12 09:59:51 2022 +0800
Remove useless parameter in `SlotMigrate::Loop` (#974)
---
src/slot_migrate.cc | 6 +++---
src/slot_migrate.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/slot_migrate.cc b/src/slot_migrate.cc
index ed6fe58..713a8e7 100644
--- a/src/slot_migrate.cc
+++ b/src/slot_migrate.cc
@@ -135,7 +135,7 @@ Status SlotMigrate::CreateMigrateHandleThread(void) {
t_ = std::thread([this]() {
Util::ThreadSetName("slot-migrate");
thread_state_ = ThreadState::Running;
- this->Loop(static_cast<void*>(this));
+ this->Loop();
});
} catch(const std::exception &e) {
return Status(Status::NotOK, std::string(e.what()));
@@ -143,7 +143,7 @@ Status SlotMigrate::CreateMigrateHandleThread(void) {
return Status::OK();
}
-void *SlotMigrate::Loop(void *arg) {
+void SlotMigrate::Loop() {
while (true) {
std::unique_lock<std::mutex> ul(this->job_mutex_);
while (!IsTerminated() && this->slot_job_ == nullptr) {
@@ -152,7 +152,7 @@ void *SlotMigrate::Loop(void *arg) {
ul.unlock();
if (IsTerminated()) {
- return nullptr;
+ return;
}
LOG(INFO) << "[migrate] migrate_slot: " << slot_job_->migrate_slot_
diff --git a/src/slot_migrate.h b/src/slot_migrate.h
index 9ac6862..08df9ba 100644
--- a/src/slot_migrate.h
+++ b/src/slot_migrate.h
@@ -86,7 +86,7 @@ class SlotMigrate : public Redis::Database {
~SlotMigrate();
Status CreateMigrateHandleThread(void);
- void *Loop(void *arg);
+ void Loop();
Status MigrateStart(Server *svr, const std::string &node_id, const std::string dst_ip,
int dst_port, int slot, int speed, int pipeline_size, int seq_gap);
void ReleaseForbiddenSlot();