diff options
| author | Léo Lam <leo@leolam.fr> | 2021-03-12 00:34:11 +0100 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2021-03-12 00:35:27 +0100 |
| commit | b90017bf3b3e0839dc45caed5f8f8f6ed6bbec9d (patch) | |
| tree | 1ea499db1d818d89b9fb5f1ac6d2002de92c816e /src/KingSystem/Utils/Thread | |
| parent | 69c78356b3f193b39e86f2a5aaf31ce82cc2e768 (diff) | |
ksys/util: Make TaskMgr task type checks optional
They are not always done.
Diffstat (limited to 'src/KingSystem/Utils/Thread')
| -rw-r--r-- | src/KingSystem/Utils/Thread/TaskMgr.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/KingSystem/Utils/Thread/TaskMgr.h b/src/KingSystem/Utils/Thread/TaskMgr.h index b200e5f1..8b94e53e 100644 --- a/src/KingSystem/Utils/Thread/TaskMgr.h +++ b/src/KingSystem/Utils/Thread/TaskMgr.h @@ -42,8 +42,8 @@ public: void init(s32 num_tasks, sead::Heap* heap, ManagedTaskFactory& factory); template <typename TaskType> - void init(s32 num_tasks, sead::Heap* heap) { - initImpl_<TaskType>(num_tasks, heap); + void init(s32 num_tasks, sead::Heap* heap, bool check_task_type = false) { + initImpl_<TaskType>(num_tasks, heap, check_task_type); } void finalize(); @@ -87,11 +87,11 @@ protected: } template <typename TaskType> - void initImpl_(s32 num_tasks, sead::Heap* heap) { + void initImpl_(s32 num_tasks, sead::Heap* heap, bool check_task_type) { sead::Delegate1<TaskMgr, ManagedTask**> factory{this, &TaskMgr::makeTaskType_<TaskType>}; init(num_tasks, heap, factory); - if (hasTasks()) { + if (check_task_type && hasTasks()) { Task* task = nullptr; if (mFreeTaskLists[0].size() >= 1) task = mFreeTaskLists[0].front(); |
