From 5608dc0d5ed388686688af8dd3f4f8e7c8588491 Mon Sep 17 00:00:00 2001 From: wxyu Date: Sun, 18 Aug 2019 19:59:56 +0800 Subject: [PATCH] MS-374 Add action definition Former-commit-id: e98698b711631419b396ccb34c7b4e131118bb5b --- .../scheduler/action/PushTaskToNeighbour.cpp | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/cpp/src/scheduler/action/PushTaskToNeighbour.cpp b/cpp/src/scheduler/action/PushTaskToNeighbour.cpp index 4347ee84..c99f490f 100644 --- a/cpp/src/scheduler/action/PushTaskToNeighbour.cpp +++ b/cpp/src/scheduler/action/PushTaskToNeighbour.cpp @@ -13,19 +13,15 @@ namespace engine { void push_task(ResourcePtr &self, ResourcePtr &other) { - auto self_task_table = self->task_table(); - auto other_task_table = other->task_table(); - if (!other_task_table.Empty()) { - CacheMgr cache; - auto indexes = PickToMove(self_task_table, cache, 1); - for (auto index : indexes) { - if (self_task_table.Move(index)) { - auto task = self_task_table.Get(index)->task; - other_task_table.Put(task); - // TODO: mark moved future - other->WakeupLoader(); - other->WakeupExecutor(); - } + auto &self_task_table = self->task_table(); + auto &other_task_table = other->task_table(); + CacheMgr cache; + auto indexes = PickToMove(self_task_table, cache, 1); + for (auto index : indexes) { + if (self_task_table.Move(index)) { + auto task = self_task_table.Get(index)->task; + other_task_table.Put(task); + // TODO: mark moved future } } } -- GitLab