mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
lv2: Minor optimization for "awake all" threads in sleep queue
This commit is contained in:
parent
b84b8f4db4
commit
37ce7056ac
3 changed files with 5 additions and 5 deletions
|
@ -377,8 +377,8 @@ error_code sys_event_flag_cancel(ppu_thread& ppu, u32 id, vm::ptr<u32> num)
|
||||||
// Set count
|
// Set count
|
||||||
value = ::size32(flag->sq);
|
value = ::size32(flag->sq);
|
||||||
|
|
||||||
// Signal all threads to return CELL_ECANCELED
|
// Signal all threads to return CELL_ECANCELED (protocol does not matter)
|
||||||
while (auto thread = flag->schedule<ppu_thread>(flag->sq, flag->protocol))
|
for (auto thread : ::as_rvalue(std::move(flag->sq)))
|
||||||
{
|
{
|
||||||
auto& ppu = static_cast<ppu_thread&>(*thread);
|
auto& ppu = static_cast<ppu_thread&>(*thread);
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,7 @@ error_code _sys_lwcond_signal_all(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id
|
||||||
|
|
||||||
u32 result = 0;
|
u32 result = 0;
|
||||||
|
|
||||||
while (const auto cpu = cond.schedule<ppu_thread>(cond.sq, cond.protocol))
|
for (const auto cpu : ::as_rvalue(std::move(cond.sq)))
|
||||||
{
|
{
|
||||||
cond.waiters--;
|
cond.waiters--;
|
||||||
|
|
||||||
|
|
|
@ -363,7 +363,7 @@ error_code sys_rwlock_wlock(ppu_thread& ppu, u32 rw_lock_id, u64 timeout)
|
||||||
});
|
});
|
||||||
|
|
||||||
// Protocol doesn't matter here since they are all enqueued anyways
|
// Protocol doesn't matter here since they are all enqueued anyways
|
||||||
while (auto cpu = rwlock->schedule<ppu_thread>(rwlock->rq, SYS_SYNC_FIFO))
|
for (auto cpu : ::as_rvalue(std::move(rwlock->rq)))
|
||||||
{
|
{
|
||||||
rwlock->append(cpu);
|
rwlock->append(cpu);
|
||||||
}
|
}
|
||||||
|
@ -456,7 +456,7 @@ error_code sys_rwlock_wunlock(ppu_thread& ppu, u32 rw_lock_id)
|
||||||
}
|
}
|
||||||
else if (auto readers = rwlock->rq.size())
|
else if (auto readers = rwlock->rq.size())
|
||||||
{
|
{
|
||||||
while (auto cpu = rwlock->schedule<ppu_thread>(rwlock->rq, SYS_SYNC_FIFO))
|
for (auto cpu : ::as_rvalue(std::move(rwlock->rq)))
|
||||||
{
|
{
|
||||||
rwlock->append(cpu);
|
rwlock->append(cpu);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue