mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 01:08:39 +12:00
sys_usbd: Improved usb_handler_thread timing
This commit is contained in:
parent
71c3264ea7
commit
7648171fe2
1 changed files with 5 additions and 2 deletions
|
@ -367,7 +367,7 @@ usb_handler_thread::~usb_handler_thread()
|
||||||
|
|
||||||
void usb_handler_thread::operator()()
|
void usb_handler_thread::operator()()
|
||||||
{
|
{
|
||||||
timeval lusb_tv{0, 200};
|
timeval lusb_tv{0, 0};
|
||||||
|
|
||||||
while (ctx && thread_ctrl::state() != thread_state::aborting)
|
while (ctx && thread_ctrl::state() != thread_state::aborting)
|
||||||
{
|
{
|
||||||
|
@ -405,7 +405,10 @@ void usb_handler_thread::operator()()
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is no handled devices usb thread is not actively needed
|
// If there is no handled devices usb thread is not actively needed
|
||||||
thread_ctrl::wait_for(handled_devices.empty() ? 500'000 : 200);
|
if (handled_devices.empty())
|
||||||
|
thread_ctrl::wait_for(500'000);
|
||||||
|
else
|
||||||
|
std::this_thread::yield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue