mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 22:41:25 +12:00
* replace GetThreadID with std::this_thread.getId() * name all anonymous structs and unions that contain non-trivially constructable objects * made default constructor for big endian type noexcept to make it work with std::atomic * move instantiated specialized template function members ouside of the class definition to comply with the standard * added default instantiation for template parameter "=nullptr" * used the C++11 standardized thread_local instead of the __declspec(thread) * added transitional definitions to bridge the microsoft specific calls (compare and exchange and aligned alloc) * removed cyclic dependency between Emulator->CPUThreadManager->CPUThread->SMutex->Emulator->... * fixed some instances of indentation by space instead of tabs * surrounded some unused code with an #if 0 block to make sure it doesn't compile
38 lines
733 B
C++
38 lines
733 B
C++
#pragma once
|
|
#include "PPCThread.h"
|
|
|
|
enum PPCThreadType
|
|
{
|
|
PPC_THREAD_PPU,
|
|
PPC_THREAD_SPU,
|
|
PPC_THREAD_RAW_SPU
|
|
};
|
|
|
|
class PPCThreadManager
|
|
{
|
|
//IdManager m_threads_id;
|
|
//ArrayF<PPUThread> m_ppu_threads;
|
|
//ArrayF<SPUThread> m_spu_threads;
|
|
ArrayF<PPCThread> m_threads;
|
|
std::mutex m_mtx_thread;
|
|
wxSemaphore m_sem_task;
|
|
Stack<u32> m_delete_threads;
|
|
u32 m_raw_spu_num;
|
|
|
|
public:
|
|
PPCThreadManager();
|
|
~PPCThreadManager();
|
|
|
|
void Close();
|
|
|
|
PPCThread& AddThread(PPCThreadType type);
|
|
void RemoveThread(const u32 id);
|
|
|
|
ArrayF<PPCThread>& GetThreads() { return m_threads; }
|
|
s32 GetThreadNumById(PPCThreadType type, u32 id);
|
|
PPCThread* GetThread(u32 id);
|
|
//IdManager& GetIDs() {return m_threads_id;}
|
|
|
|
void Exec();
|
|
void Task();
|
|
};
|