mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-20 22:05:12 +00:00
Fix most of "[x] thread is too sleepy" at Emu.Stop() (#9813)
* Fixes some thread sleep/wait calls
This commit is contained in:
parent
a47bda026b
commit
eb0d006168
11 changed files with 21 additions and 17 deletions
|
|
@ -104,7 +104,7 @@ struct msg_dlg_thread_info
|
|||
if (wait_until.load() != new_value)
|
||||
break;
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
thread_ctrl::wait_for(10'000);
|
||||
}
|
||||
|
||||
if (auto manager = g_fxo->get<rsx::overlays::display_manager>())
|
||||
|
|
|
|||
|
|
@ -569,7 +569,7 @@ static NEVER_INLINE error_code savedata_op(ppu_thread& ppu, u32 operation, u32 v
|
|||
const auto lv2_sleep = [](ppu_thread& ppu, usz sleep_time)
|
||||
{
|
||||
lv2_obj::sleep(ppu);
|
||||
std::this_thread::sleep_for(std::chrono::microseconds(sleep_time));
|
||||
lv2_obj::wait_timeout(sleep_time);
|
||||
ppu.check_state();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -362,6 +362,11 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
if (auto cpu0 = get_current_cpu_thread(); cpu0 && cpu0->is_stopped())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (thread_ctrl::state() == thread_state::aborting)
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -304,10 +304,7 @@ void usb_handler_thread::operator()()
|
|||
}
|
||||
|
||||
// If there is no handled devices usb thread is not actively needed
|
||||
if (handled_devices.empty())
|
||||
std::this_thread::sleep_for(500ms);
|
||||
else
|
||||
std::this_thread::sleep_for(200us);
|
||||
thread_ctrl::wait_for(handled_devices.empty() ? 500'000 : 200);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue