diff options
author | chai <chaifix@163.com> | 2021-10-25 23:29:21 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-25 23:29:21 +0800 |
commit | 7ecf913256fb396e3027aac3318d996a716a52ef (patch) | |
tree | 4540835c881a63b665e2a692bf30115fd29e8bb0 /Runtime/Threading/JobSystem.h | |
parent | 0816cd70ca1a213b6ed872bcf3c0bf0912473722 (diff) |
+ job system
Diffstat (limited to 'Runtime/Threading/JobSystem.h')
-rw-r--r-- | Runtime/Threading/JobSystem.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Runtime/Threading/JobSystem.h b/Runtime/Threading/JobSystem.h new file mode 100644 index 0000000..c95037c --- /dev/null +++ b/Runtime/Threading/JobSystem.h @@ -0,0 +1,22 @@ +#pragma once +#include "Runtime/Utilities/Singleton.h" +#include "Runtime/Threading/Thread.h" +#include <vector> + +class JobSystem : public Singleton<JobSystem> +{ +public: + JobSystem(); + ~JobSystem(); + + void AddJobAtEnd(Job* job); + + void Initilize(int workThreadCount = 1); + void Dispatch(void* param); + +private: + WorkThread* SelectThread(); + + std::vector<WorkThread*> m_Threads; + +};
\ No newline at end of file |