diff --git a/Utilities/lockless.h b/Utilities/lockless.h index 84064a3110..62b9a08bdd 100644 --- a/Utilities/lockless.h +++ b/Utilities/lockless.h @@ -363,11 +363,6 @@ public: } } - void notify() noexcept - { - m_head.notify_one(); - } - template void push(Args&&... args) { @@ -378,6 +373,12 @@ public: { item->m_link = reinterpret_cast*>(_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()) ... diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index 3c9e7a9b03..c871e999c5 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -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::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::cptrin_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; }