rpcsx/rpcs3/Emu/CPU/CPUThreadManager.h

32 lines
701 B
C
Raw Normal View History

#pragma once
class CPUThread;
enum CPUThreadType : unsigned char;
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;
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; }
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);
void Exec();
void Task();
};