Skip to content

Commit

Permalink
sys_usbd: Improved usb_handler_thread timing
Browse files Browse the repository at this point in the history
  • Loading branch information
brian218 authored and Megamouse committed Jan 26, 2023
1 parent 71c3264 commit 7648171
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rpcs3/Emu/Cell/lv2/sys_usbd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ usb_handler_thread::~usb_handler_thread()

void usb_handler_thread::operator()()
{
timeval lusb_tv{0, 200};
timeval lusb_tv{0, 0};

while (ctx && thread_ctrl::state() != thread_state::aborting)
{
Expand Down Expand Up @@ -405,7 +405,10 @@ void usb_handler_thread::operator()()
}

// 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();
}
}

Expand Down

0 comments on commit 7648171

Please sign in to comment.