SC_Semaphore rewritten

This commit is contained in:
Nekotekina 2014-06-21 18:24:27 +04:00
parent e79236a97f
commit 5da33c6243
9 changed files with 254 additions and 101 deletions

View file

@ -108,6 +108,22 @@ CPUThread* CPUThreadManager::GetThread(u32 id)
return res;
}
void CPUThreadManager::NotifyThread(const u32 id)
{
if (!id) return;
std::lock_guard<std::mutex> lock(m_mtx_thread);
for (u32 i = 0; i < m_threads.size(); i++)
{
if (m_threads[i]->GetId() == id)
{
m_threads[i]->Notify();
return;
}
}
}
void CPUThreadManager::Exec()
{
std::lock_guard<std::mutex> lock(m_mtx_thread);