summaryrefslogtreecommitdiff
path: root/Client/Source/Threading/JobSystem.h
blob: ded4370a14578c52fd83098e315a5b1522190b67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;

};