diff options
author | bunnei <bunneidev@gmail.com> | 2020-02-27 00:35:35 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-02-27 00:35:35 +0100 |
commit | a17214baeac6df1d986acbeb4ee266a65db02c8e (patch) | |
tree | 300e425acc5b7efcfb089010870af1b8b940d628 /src | |
parent | renderer_opengl: Move Frame/FrameMailbox to OpenGL namespace. (diff) | |
download | yuzu-a17214baeac6df1d986acbeb4ee266a65db02c8e.tar yuzu-a17214baeac6df1d986acbeb4ee266a65db02c8e.tar.gz yuzu-a17214baeac6df1d986acbeb4ee266a65db02c8e.tar.bz2 yuzu-a17214baeac6df1d986acbeb4ee266a65db02c8e.tar.lz yuzu-a17214baeac6df1d986acbeb4ee266a65db02c8e.tar.xz yuzu-a17214baeac6df1d986acbeb4ee266a65db02c8e.tar.zst yuzu-a17214baeac6df1d986acbeb4ee266a65db02c8e.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index e516ede9d..3280020af 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -65,7 +65,7 @@ public: ~FrameMailbox() { // lock the mutex and clear out the present and free_queues and notify any people who are // blocked to prevent deadlock on shutdown - std::scoped_lock lock(swap_chain_lock); + std::scoped_lock lock{swap_chain_lock}; std::queue<Frame*>().swap(free_queue); present_queue.clear(); present_cv.notify_all(); @@ -115,7 +115,7 @@ public: } Frame* GetRenderFrame() { - std::unique_lock<std::mutex> lock(swap_chain_lock); + std::unique_lock lock{swap_chain_lock}; // If theres no free frames, we will reuse the oldest render frame if (free_queue.empty()) { @@ -130,13 +130,13 @@ public: } void ReleaseRenderFrame(Frame* frame) { - std::unique_lock<std::mutex> lock(swap_chain_lock); + std::unique_lock lock{swap_chain_lock}; present_queue.push_front(frame); present_cv.notify_one(); } Frame* TryGetPresentFrame(int timeout_ms) { - std::unique_lock<std::mutex> lock(swap_chain_lock); + std::unique_lock lock{swap_chain_lock}; // wait for new entries in the present_queue present_cv.wait_for(lock, std::chrono::milliseconds(timeout_ms), [&] { return !present_queue.empty(); }); |