From: Inki Dae Date: Thu, 16 May 2024 02:29:47 +0000 (+0900) Subject: services: do not use _threads as class member X-Git-Tag: accepted/tizen/unified/20240903.110722~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=610f2c8c7ab7ff0c7111cf7e172811646d54ccd5;p=platform%2Fcore%2Fapi%2Fsingleo.git services: do not use _threads as class member Do not use _threads as class member. It's enogh with local threads handles so drop _threads from class member and use local one instead. Change-Id: Id99b0b5d51e5f02ff09aae1647be7e2645491e37 Signed-off-by: Inki Dae --- diff --git a/services/task_manager/include/TaskManager.h b/services/task_manager/include/TaskManager.h index f621954..2450b76 100644 --- a/services/task_manager/include/TaskManager.h +++ b/services/task_manager/include/TaskManager.h @@ -34,7 +34,6 @@ class TaskManager private: std::vector > _inputs; std::vector > _nodes; - std::vector > _threads; std::vector > _results; void threadCb(std::shared_ptr &node); diff --git a/services/task_manager/src/TaskManager.cpp b/services/task_manager/src/TaskManager.cpp index 0ac1960..abaf0b0 100644 --- a/services/task_manager/src/TaskManager.cpp +++ b/services/task_manager/src/TaskManager.cpp @@ -120,6 +120,8 @@ void TaskManager::run() throw InvalidOperation("No input source."); } + std::vector > threads; + for (auto &n : _nodes) { // Set input as source of current node. // If no dependency then this node has to receive input source @@ -141,14 +143,13 @@ void TaskManager::run() for (auto &d : dependencies) d->wait(); - _threads.push_back(make_shared(&TaskManager::threadCb, this, std::ref(n))); + threads.push_back(make_unique(&TaskManager::threadCb, this, std::ref(n))); } - for (auto &t : _threads) + for (auto &t : threads) t->join(); _inputs.clear(); - _threads.clear(); } vector > &TaskManager::output()