本文整理汇总了C++中CPUThread::GetPrio方法的典型用法代码示例。如果您正苦于以下问题:C++ CPUThread::GetPrio方法的具体用法?C++ CPUThread::GetPrio怎么用?C++ CPUThread::GetPrio使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPUThread
的用法示例。
在下文中一共展示了CPUThread::GetPrio方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sys_ppu_thread_get_priority
s32 sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
{
sys_ppu_thread.Log("sys_ppu_thread_get_priority(thread_id=%lld, prio_addr=0x%x)", thread_id, prio_addr);
CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
if(!thr) return CELL_ESRCH;
Memory.Write32(prio_addr, (s32)thr->GetPrio());
return CELL_OK;
}
示例2: sys_ppu_thread_get_priority
s32 sys_ppu_thread_get_priority(u64 thread_id, u32 prio_addr)
{
sysPrxForUser->Log("sys_ppu_thread_get_priority(thread_id=%lld, prio_addr=0x%x)", thread_id, prio_addr);
CPUThread* thr = Emu.GetCPU().GetThread(thread_id);
if(!thr) return CELL_ESRCH;
if(!Memory.IsGoodAddr(prio_addr)) return CELL_EFAULT;
Memory.Write32(prio_addr, thr->GetPrio());
return CELL_OK;
}
示例3: pop_prio
u32 SleepQueue::pop_prio() // SYS_SYNC_PRIORITY
{
std::lock_guard<std::mutex> lock(m_mutex);
while (true)
{
if (list.size())
{
u32 highest_prio = ~0;
u32 sel = 0;
for (u32 i = 0; i < list.size(); i++)
{
CPUThread* t = Emu.GetCPU().GetThread(list[i]);
if (!t)
{
list[i] = 0;
sel = i;
break;
}
u64 prio = t->GetPrio();
if (prio < highest_prio)
{
highest_prio = prio;
sel = i;
}
}
u32 res = list[sel];
list.erase(list.begin() + sel);
/* if (Emu.GetIdManager().CheckID(res)) */
if (res)
// check thread
{
return res;
}
}
return 0;
}
}