#include "stdafx.h" #include "PPCThreadManager.h" #include "PPUThread.h" #include "SPUThread.h" PPCThreadManager::PPCThreadManager() : ThreadBase(true, "PPCThreadManager") { } PPCThreadManager::~PPCThreadManager() { Close(); } void PPCThreadManager::Close() { if(IsAlive()) Stop(); while(m_threads.GetCount()) RemoveThread(m_threads[0].GetId()); } PPCThread& PPCThreadManager::AddThread(bool isPPU) { PPCThread* new_thread = isPPU ? (PPCThread*)new PPUThread() : (PPCThread*)new SPUThread(); new_thread->SetId(Emu.GetIdManager().GetNewID( wxString::Format("%s Thread", isPPU ? "PPU" : "SPU"), new_thread, 0) ); m_threads.Add(new_thread); return *new_thread; } void PPCThreadManager::RemoveThread(const u32 id) { for(u32 i=0; i