mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Fix user_interface::alloc_thread_bit() usage
This commit is contained in:
parent
50ad7ba1f6
commit
5600430a05
@ -242,10 +242,18 @@ namespace rsx
|
||||
{
|
||||
if (!exit)
|
||||
{
|
||||
g_fxo->get<named_thread<msg_dialog_thread>>()([&, tbit = alloc_thread_bit()]()
|
||||
auto& dlg_thread = g_fxo->get<named_thread<msg_dialog_thread>>();
|
||||
|
||||
const auto notify = std::make_shared<atomic_t<bool>>(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<display_manager>().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});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1034,10 +1034,18 @@ namespace rsx
|
||||
|
||||
update_panel();
|
||||
|
||||
g_fxo->get<named_thread<osk_dialog_thread>>()([this, tbit = alloc_thread_bit()]
|
||||
auto& osk_thread = g_fxo->get<named_thread<osk_dialog_thread>>();
|
||||
|
||||
const auto notify = std::make_shared<atomic_t<bool>>(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});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -199,10 +199,18 @@ namespace rsx
|
||||
this->on_close = std::move(on_close);
|
||||
visible = true;
|
||||
|
||||
g_fxo->get<named_thread<user_list_dialog_thread>>()([&, tbit = alloc_thread_bit()]()
|
||||
auto& list_thread = g_fxo->get<named_thread<user_list_dialog_thread>>();
|
||||
|
||||
const auto notify = std::make_shared<atomic_t<bool>>(false);
|
||||
|
||||
list_thread([&, notify]()
|
||||
{
|
||||
const u64 tbit = alloc_thread_bit();
|
||||
g_thread_bit = tbit;
|
||||
|
||||
*notify = true;
|
||||
notify->notify_one();
|
||||
|
||||
auto ref = g_fxo->get<display_manager>().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
|
||||
|
Loading…
Reference in New Issue
Block a user