diff --git a/frameworks/core/task_manager.cpp b/frameworks/core/task_manager.cpp index 25e435578606fcb544299d84a35745907961ac8c..3cd67f05d0c038c96750d1b6af5ffad0f835503b 100755 --- a/frameworks/core/task_manager.cpp +++ b/frameworks/core/task_manager.cpp @@ -24,6 +24,7 @@ TaskManager* TaskManager::GetInstance() static TaskManager taskManager; return &taskManager; } + void TaskManager::Add(Task* task) { if (task == nullptr) { diff --git a/interfaces/innerkits/common/task_manager.h b/interfaces/innerkits/common/task_manager.h index 8d482538e2a6cd0798b536944a9a7ae55f2e4718..f0e0389a535f701736dc3659cc697a93e450ecd5 100755 --- a/interfaces/innerkits/common/task_manager.h +++ b/interfaces/innerkits/common/task_manager.h @@ -70,17 +70,18 @@ public: */ void ResetTaskHandlerMutex(); -protected: - List list_; /* the task list */ - bool canTaskRun_; - bool isHandlerRunning_; - uint8_t idleLast_; - private: - TaskManager() : canTaskRun_(false), isHandlerRunning_(false), idleLast_(0) {} + TaskManager() : canTaskRun_(false), isHandlerRunning_(false) {} ~TaskManager() {} - static const uint16_t IDLE_MEAS_PERIOD = 500; + TaskManager(const TaskManager&) = delete; + TaskManager& operator=(const TaskManager&) = delete; + TaskManager(TaskManager&&) = delete; + TaskManager& operator=(TaskManager&&) = delete; + + List list_; /* the task list */ + bool canTaskRun_; + bool isHandlerRunning_; }; } // namespace OHOS #endif // GRAPHIC_LITE_TASK_MANAGER_H