summaryrefslogtreecommitdiffstats
path: root/src/video_core/control/scheduler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/control/scheduler.cpp')
-rw-r--r--src/video_core/control/scheduler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/video_core/control/scheduler.cpp b/src/video_core/control/scheduler.cpp
index 733042690..f7cbe204e 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);
}