2013-11-03 20:23:16 +01:00
|
|
|
#pragma once
|
2014-08-25 16:56:13 +02:00
|
|
|
|
2014-02-23 17:52:52 +01:00
|
|
|
class CPUThread;
|
2014-06-23 03:03:16 +02:00
|
|
|
class RawSPUThread;
|
2014-02-23 17:52:52 +01:00
|
|
|
enum CPUThreadType : unsigned char;
|
2013-11-03 20:23:16 +01:00
|
|
|
|
|
|
|
|
class CPUThreadManager
|
|
|
|
|
{
|
2014-04-10 00:54:32 +02:00
|
|
|
std::vector<CPUThread*> m_threads;
|
2013-11-03 20:23:16 +01:00
|
|
|
std::mutex m_mtx_thread;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CPUThreadManager();
|
|
|
|
|
~CPUThreadManager();
|
|
|
|
|
|
|
|
|
|
void Close();
|
|
|
|
|
|
|
|
|
|
CPUThread& AddThread(CPUThreadType type);
|
|
|
|
|
void RemoveThread(const u32 id);
|
2014-06-21 16:24:27 +02:00
|
|
|
void NotifyThread(const u32 id);
|
2013-11-03 20:23:16 +01:00
|
|
|
|
2014-04-10 00:54:32 +02:00
|
|
|
std::vector<CPUThread*>& GetThreads() { return m_threads; }
|
2013-11-03 20:23:16 +01:00
|
|
|
s32 GetThreadNumById(CPUThreadType type, u32 id);
|
|
|
|
|
CPUThread* GetThread(u32 id);
|
2014-06-23 03:03:16 +02:00
|
|
|
RawSPUThread* GetRawSPUThread(u32 num);
|
2013-11-03 20:23:16 +01:00
|
|
|
|
|
|
|
|
void Exec();
|
|
|
|
|
void Task();
|
2014-02-23 17:52:52 +01:00
|
|
|
};
|