diff options
| author | Léo Lam <leo@leolam.fr> | 2020-09-10 22:11:27 +0200 |
|---|---|---|
| committer | Léo Lam <leo@leolam.fr> | 2020-09-15 17:54:16 +0200 |
| commit | 8b7369dffb1e816b2f27ab0133d2bac218383a45 (patch) | |
| tree | c5d6a577ec9102e65a6e08272432dfa862670a60 /src/KingSystem/Utils/Thread/TaskQueue.h | |
| parent | c5ef0a1fd3629a27dc2fc7de7a46347c6cb3518e (diff) | |
ksys: Add Task utilities
Diffstat (limited to 'src/KingSystem/Utils/Thread/TaskQueue.h')
| -rw-r--r-- | src/KingSystem/Utils/Thread/TaskQueue.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/KingSystem/Utils/Thread/TaskQueue.h b/src/KingSystem/Utils/Thread/TaskQueue.h new file mode 100644 index 00000000..6792a783 --- /dev/null +++ b/src/KingSystem/Utils/Thread/TaskQueue.h @@ -0,0 +1,21 @@ +#pragma once + +#include <thread/seadCriticalSection.h> +#include "KingSystem/Utils/Thread/TaskQueueBase.h" + +namespace ksys::util { + +class TaskQueue : public TaskQueueBase { + SEAD_RTTI_OVERRIDE(TaskQueue, TaskQueueBase) +public: + explicit TaskQueue(sead::Heap* heap); + +private: + void lock() const override { mCS.lock(); } + void unlock() const override { mCS.unlock(); } + + mutable sead::CriticalSection mCS; +}; +KSYS_CHECK_SIZE_NX150(TaskQueue, 0xd0); + +} // namespace ksys::util |
