From d866916f42c3bbb21aa6f046140737690c1ce47f Mon Sep 17 00:00:00 2001 From: ameerj <52414509+ameerj@users.noreply.github.com> Date: Mon, 3 Jan 2022 12:31:33 -0500 Subject: 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. --- src/video_core/gpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/video_core/gpu.h') diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 500411176..cc65a7870 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include "common/bit_field.h" #include "common/common_types.h" @@ -209,7 +210,7 @@ public: [[nodiscard]] const VideoCore::ShaderNotify& ShaderNotify() const; /// Allows the CPU/NvFlinger to wait on the GPU before presenting a frame. - void WaitFence(u32 syncpoint_id, u32 value); + void WaitFence(u32 syncpoint_id, u32 value, std::stop_token stop_token = {}); void IncrementSyncPoint(u32 syncpoint_id); -- cgit v1.2.3