gpu: Use std::stop_token in WaitFence for VSync thread

Fixes a hang that may occur when stopping emulation and the VSync thread is blocked on the syncpoint condition variable.
This commit is contained in:
ameerj
2022-01-03 12:31:33 -05:00
parent da8e0f6571
commit d866916f42
3 changed files with 10 additions and 15 deletions

View File

@ -266,10 +266,11 @@ void NVFlinger::Compose() {
auto& gpu = system.GPU();
const auto& multi_fence = buffer->get().multi_fence;
const auto stop_token = vsync_thread.get_stop_token();
guard->unlock();
for (u32 fence_id = 0; fence_id < multi_fence.num_fences; fence_id++) {
const auto& fence = multi_fence.fences[fence_id];
gpu.WaitFence(fence.id, fence.value);
gpu.WaitFence(fence.id, fence.value, stop_token);
}
guard->lock();