本文整理汇总了C++中CPUThread::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ CPUThread::Close方法的具体用法?C++ CPUThread::Close怎么用?C++ CPUThread::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPUThread
的用法示例。
在下文中一共展示了CPUThread::Close方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveThread
void CPUThreadManager::RemoveThread(const u32 id)
{
std::lock_guard<std::mutex> lock(m_mtx_thread);
for(u32 i=0; i<m_threads.GetCount(); ++i)
{
if(m_threads[i].m_wait_thread_id == id)
{
m_threads[i].Wait(false);
m_threads[i].m_wait_thread_id = -1;
}
if(m_threads[i].GetId() != id) continue;
CPUThread* thr = &m_threads[i];
#ifndef QT_UI
wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr);
#endif
thr->Close();
m_threads.RemoveFAt(i);
break;
}
Emu.GetIdManager().RemoveID(id);
Emu.CheckStatus();
}
示例2: RemoveThread
void CPUThreadManager::RemoveThread(const u32 id)
{
std::lock_guard<std::mutex> lock(m_mtx_thread);
CPUThread* thr = nullptr;
u32 thread_index = 0;
for (u32 i = 0; i < m_threads.size(); ++i)
{
if (m_threads[i]->m_wait_thread_id == id)
{
m_threads[i]->Wait(false);
m_threads[i]->m_wait_thread_id = -1;
}
if (m_threads[i]->GetId() != id) continue;
thr = m_threads[i];
thread_index = i;
}
if (thr)
{
#ifndef QT_UI
wxGetApp().SendDbgCommand(DID_REMOVE_THREAD, thr);
#endif
thr->Close();
m_threads.erase(m_threads.begin() + thread_index);
}
// Removing the ID should trigger the actual deletion of the thread
Emu.GetIdManager().RemoveID(id);
Emu.CheckStatus();
}