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;
|
|
|
|
|
enum CPUThreadType : unsigned char;
|
2013-11-03 20:23:16 +01:00
|
|
|
|
|
|
|
|
class CPUThreadManager
|
|
|
|
|
{
|
2015-03-04 22:51:14 +01:00
|
|
|
std::mutex m_mutex;
|
|
|
|
|
|
2014-12-24 00:38:13 +01:00
|
|
|
std::vector<std::shared_ptr<CPUThread>> m_threads;
|
2015-03-04 22:51:14 +01:00
|
|
|
std::array<std::shared_ptr<CPUThread>, 5> m_raw_spu;
|
2013-11-03 20:23:16 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
CPUThreadManager();
|
|
|
|
|
~CPUThreadManager();
|
|
|
|
|
|
|
|
|
|
void Close();
|
|
|
|
|
|
2015-03-04 22:51:14 +01:00
|
|
|
std::shared_ptr<CPUThread> AddThread(CPUThreadType type);
|
|
|
|
|
|
|
|
|
|
void RemoveThread(u32 id);
|
|
|
|
|
|
|
|
|
|
std::vector<std::shared_ptr<CPUThread>> GetThreads() { std::lock_guard<std::mutex> lock(m_mutex); return m_threads; }
|
2013-11-03 20:23:16 +01:00
|
|
|
|
2014-12-24 00:38:13 +01:00
|
|
|
std::shared_ptr<CPUThread> GetThread(u32 id);
|
2015-01-23 22:48:14 +01:00
|
|
|
std::shared_ptr<CPUThread> GetThread(u32 id, CPUThreadType type);
|
2015-03-04 22:51:14 +01:00
|
|
|
std::shared_ptr<CPUThread> GetRawSPUThread(u32 index);
|
2013-11-03 20:23:16 +01:00
|
|
|
|
|
|
|
|
void Exec();
|
|
|
|
|
void Task();
|
2014-02-23 17:52:52 +01:00
|
|
|
};
|