From 89b8be98d6830a8758a758cacfc139ee04ddeaf0 Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Sun, 31 Dec 2023 20:28:00 +0200 Subject: [PATCH] Simplify lv2_timer_thread management --- rpcs3/Emu/Cell/lv2/sys_timer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/sys_timer.cpp b/rpcs3/Emu/Cell/lv2/sys_timer.cpp index 29807be4ef..1dc245da3a 100644 --- a/rpcs3/Emu/Cell/lv2/sys_timer.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_timer.cpp @@ -25,7 +25,7 @@ struct lv2_timer_thread lv2_timer_thread(); void operator()(); - SAVESTATE_INIT_POS(46); // Dependency on LV2 objects (lv2_timer) + //SAVESTATE_INIT_POS(46); // FREE SAVESTATE_INIT_POS number static constexpr auto thread_name = "Timer Thread"sv; }; @@ -105,9 +105,12 @@ u64 lv2_timer::check_unlocked(u64 _now) noexcept lv2_timer_thread::lv2_timer_thread() { - idm::select([&](u32 id, lv2_timer&) + Emu.DeferDeserialization([this]() { - timers.emplace_back(idm::get_unlocked(id)); + idm::select([&](u32 id, lv2_timer&) + { + timers.emplace_back(idm::get_unlocked(id)); + }); }); }