cdvdgigaherz: Avoid holding lock during thread sleep

Fixes Coverity CID 127721: Program hangs

Change the sleep to a condition variable wait, which has the added
benefit of allowing the plugin to close ever so slightly faster if
there's no disc in the drive.
This commit is contained in:
Jonathan Li 2016-11-17 20:07:01 +00:00 committed by Gregory Hainaut
parent 29c2ccb310
commit 483b3d6368
1 changed files with 1 additions and 1 deletions

View File

@ -176,7 +176,7 @@ void cdvdThread()
while (cdvd_is_open) {
if (cdvdUpdateDiscStatus()) {
// Need to sleep some to avoid an aggressive spin that sucks the cpu dry.
std::this_thread::sleep_for(std::chrono::milliseconds(10));
s_notify_cv.wait_for(guard, std::chrono::milliseconds(10));
continue;
}