diff options
author | chai <chaifix@163.com> | 2021-12-13 00:07:19 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-12-13 00:07:19 +0800 |
commit | 60cbbdec07ab7a5636eac5b3c024ae44e937f4d4 (patch) | |
tree | b2c7b0a868f18159dbc43d8954e1bd7668549a88 /Client/Source/Threading/JobSystem.h |
+init
Diffstat (limited to 'Client/Source/Threading/JobSystem.h')
-rw-r--r-- | Client/Source/Threading/JobSystem.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Client/Source/Threading/JobSystem.h b/Client/Source/Threading/JobSystem.h new file mode 100644 index 0000000..ded4370 --- /dev/null +++ b/Client/Source/Threading/JobSystem.h @@ -0,0 +1,25 @@ +#pragma once +#include "../Utilities/Singleton.h" +#include "../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(); + + bool m_Initialized; + std::vector<WorkThread*> m_Threads; + int m_Cur; + int m_ThreadCount; + +};
\ No newline at end of file |