From ca3db0d7c94a20668781830ff852dbf512598efb Mon Sep 17 00:00:00 2001
From: Fernando Sahmkow <fsahmkow27@gmail.com>
Date: Thu, 1 Sep 2022 05:45:22 +0200
Subject: General: address feedback

---
 src/video_core/control/scheduler.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/video_core/control/scheduler.cpp')

diff --git a/src/video_core/control/scheduler.cpp b/src/video_core/control/scheduler.cpp
index 7330426909..f7cbe204ee 100644
--- a/src/video_core/control/scheduler.cpp
+++ b/src/video_core/control/scheduler.cpp
@@ -3,6 +3,7 @@
 
 #include <memory>
 
+#include "common/assert.h"
 #include "video_core/control/channel_state.h"
 #include "video_core/control/scheduler.h"
 #include "video_core/gpu.h"
@@ -13,8 +14,9 @@ Scheduler::Scheduler(GPU& gpu_) : gpu{gpu_} {}
 Scheduler::~Scheduler() = default;
 
 void Scheduler::Push(s32 channel, CommandList&& entries) {
-    std::unique_lock<std::mutex> lk(scheduling_guard);
+    std::unique_lock lk(scheduling_guard);
     auto it = channels.find(channel);
+    ASSERT(it != channels.end());
     auto channel_state = it->second;
     gpu.BindChannel(channel_state->bind_id);
     channel_state->dma_pusher->Push(std::move(entries));
@@ -23,7 +25,7 @@ void Scheduler::Push(s32 channel, CommandList&& entries) {
 
 void Scheduler::DeclareChannel(std::shared_ptr<ChannelState> new_channel) {
     s32 channel = new_channel->bind_id;
-    std::unique_lock<std::mutex> lk(scheduling_guard);
+    std::unique_lock lk(scheduling_guard);
     channels.emplace(channel, new_channel);
 }
 
-- 
cgit v1.2.3-70-g09d2