diff --git a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp index 1b45c64b78..932f145e8e 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp @@ -242,10 +242,18 @@ namespace rsx { if (!exit) { - g_fxo->get>()([&, tbit = alloc_thread_bit()]() + auto& dlg_thread = g_fxo->get>(); + + const auto notify = std::make_shared>(false); + + dlg_thread([&, notify]() { + const u64 tbit = alloc_thread_bit(); g_thread_bit = tbit; + *notify = true; + notify->notify_one(); + if (interactive) { auto ref = g_fxo->get().get(uid); @@ -275,6 +283,11 @@ namespace rsx thread_bits &= ~tbit; thread_bits.notify_all(); }); + + while (dlg_thread < thread_state::errored && !*notify) + { + notify->wait(false, atomic_wait_timeout{1'000'000}); + } } } diff --git a/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp b/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp index 3c7ac31275..424aaf845f 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_osk.cpp @@ -1034,10 +1034,18 @@ namespace rsx update_panel(); - g_fxo->get>()([this, tbit = alloc_thread_bit()] + auto& osk_thread = g_fxo->get>(); + + const auto notify = std::make_shared>(false); + + osk_thread([&, notify]() { + const u64 tbit = alloc_thread_bit(); g_thread_bit = tbit; + *notify = true; + notify->notify_one(); + if (const auto error = run_input_loop()) { rsx_log.error("Osk input loop exited with error code=%d", error); @@ -1046,6 +1054,11 @@ namespace rsx thread_bits &= ~tbit; thread_bits.notify_all(); }); + + while (osk_thread < thread_state::errored && !*notify) + { + notify->wait(false, atomic_wait_timeout{1'000'000}); + } } } } diff --git a/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp index 86a05fedfb..98da87f3d8 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_user_list_dialog.cpp @@ -199,10 +199,18 @@ namespace rsx this->on_close = std::move(on_close); visible = true; - g_fxo->get>()([&, tbit = alloc_thread_bit()]() + auto& list_thread = g_fxo->get>(); + + const auto notify = std::make_shared>(false); + + list_thread([&, notify]() { + const u64 tbit = alloc_thread_bit(); g_thread_bit = tbit; + *notify = true; + notify->notify_one(); + auto ref = g_fxo->get().get(uid); if (const auto error = run_input_loop()) @@ -214,6 +222,11 @@ namespace rsx thread_bits.notify_all(); }); + while (list_thread < thread_state::errored && !*notify) + { + notify->wait(false, atomic_wait_timeout{1'000'000}); + } + return CELL_OK; } } // namespace overlays