1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 02:32:36 +01:00

lf_queue: remove explicit notify(), notify in push() instead

Should be cheap enough now if there are no waiters.
This commit is contained in:
Nekotekina 2019-10-12 22:45:17 +03:00
parent 5624b001ae
commit ac712bf4e3
2 changed files with 6 additions and 10 deletions

View File

@ -363,11 +363,6 @@ public:
}
}
void notify() noexcept
{
m_head.notify_one();
}
template <typename... Args>
void push(Args&&... args)
{
@ -378,6 +373,12 @@ public:
{
item->m_link = reinterpret_cast<lf_queue_item<T>*>(_old);
}
if (!_old)
{
// Notify only if queue was empty
m_head.notify_one();
}
}
// Withdraw the list, supports range-for loop: for (auto&& x : y.pop_all()) ...

View File

@ -514,7 +514,6 @@ error_code cellVdecClose(ppu_thread& ppu, u32 handle)
lv2_obj::sleep(ppu);
vdec->out_max = 0;
vdec->in_cmd.push(vdec_close);
vdec->in_cmd.notify();
while (!atomic_storage<u64>::load(vdec->ppu_tid))
{
@ -538,7 +537,6 @@ error_code cellVdecStartSeq(u32 handle)
}
vdec->in_cmd.push(vdec_start_seq);
vdec->in_cmd.notify();
return CELL_OK;
}
@ -554,7 +552,6 @@ error_code cellVdecEndSeq(u32 handle)
}
vdec->in_cmd.push(vdec_cmd{-1});
vdec->in_cmd.notify();
return CELL_OK;
}
@ -576,7 +573,6 @@ error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVd
// TODO: check info
vdec->in_cmd.push(vdec_cmd{mode, *auInfo});
vdec->in_cmd.notify();
return CELL_OK;
}
@ -927,7 +923,6 @@ error_code cellVdecSetFrameRate(u32 handle, CellVdecFrameRate frc)
// TODO: check frc value
vdec->in_cmd.push(frc);
vdec->in_cmd.notify();
return CELL_OK;
}