mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-26 03:55:37 +00:00
avoiding deadlocks
This commit is contained in:
parent
8a4eb9ef7a
commit
8beb7a792a
@ -311,16 +311,21 @@ void VideoOutDriver::PresentThread(std::stop_token token) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Flip(request);
|
Flip(request);
|
||||||
{
|
// add second request to avoid potential deadlocks
|
||||||
std::scoped_lock lock{request.port->port_mutex};
|
const auto second = receive_request();
|
||||||
request.port->flip_status.flip_pending_num--;
|
if (second) {
|
||||||
if (request.eop) {
|
Flip(second);
|
||||||
request.port->flip_status.gc_queue_num--;
|
{
|
||||||
|
std::scoped_lock lock{second.port->port_mutex};
|
||||||
|
second.port->flip_status.flip_pending_num--;
|
||||||
|
if (second.eop) {
|
||||||
|
second.port->flip_status.gc_queue_num--;
|
||||||
|
}
|
||||||
|
second.port->vo_cv
|
||||||
|
.notify_all(); // wake up threads waiting to submit more flips
|
||||||
}
|
}
|
||||||
request.port->vo_cv
|
FRAME_END;
|
||||||
.notify_one(); // this wake up threads waiting to submit more flips
|
|
||||||
}
|
}
|
||||||
FRAME_END;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user