mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
29c2ccb310
commit
483b3d6368
|
@ -176,7 +176,7 @@ void cdvdThread()
|
||||||
while (cdvd_is_open) {
|
while (cdvd_is_open) {
|
||||||
if (cdvdUpdateDiscStatus()) {
|
if (cdvdUpdateDiscStatus()) {
|
||||||
// Need to sleep some to avoid an aggressive spin that sucks the cpu dry.
|
// 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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue