diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-01-03 20:31:51 -0500 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2022-01-03 20:47:26 -0500 |
commit | c17938f96ba9a3f2571387b21328743db8050250 (patch) | |
tree | 23c8280d1aaf458a1abbad272e8facc3bd58eb36 /src/video_core/gpu.cpp | |
parent | 76525432317fcc4b4847c5414bed6660c85e582b (diff) |
gpu: Add shut down method to synchronize threads before destruction
Diffstat (limited to 'src/video_core/gpu.cpp')
-rw-r--r-- | src/video_core/gpu.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 8788f5148f..44fda27ef9 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -312,6 +312,12 @@ struct GPU::Impl { cpu_context->MakeCurrent(); } + void NotifyShutdown() { + std::unique_lock lk{sync_mutex}; + shutting_down.store(true, std::memory_order::relaxed); + sync_cv.notify_all(); + } + /// Obtain the CPU Context void ObtainContext() { cpu_context->MakeCurrent(); @@ -859,6 +865,10 @@ void GPU::Start() { impl->Start(); } +void GPU::NotifyShutdown() { + impl->NotifyShutdown(); +} + void GPU::ObtainContext() { impl->ObtainContext(); } |