summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-04-09 03:58:38 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:50 +0200
commit722195cf704a628aa13c5a178a07dd33c186b952 (patch)
treeffa5a3c1f38605ce4daef982db6bbfa6bd7522fb /src/core
parenthle: kernel: Migrate KEvent to KAutoObject. (diff)
downloadyuzu-722195cf704a628aa13c5a178a07dd33c186b952.tar
yuzu-722195cf704a628aa13c5a178a07dd33c186b952.tar.gz
yuzu-722195cf704a628aa13c5a178a07dd33c186b952.tar.bz2
yuzu-722195cf704a628aa13c5a178a07dd33c186b952.tar.lz
yuzu-722195cf704a628aa13c5a178a07dd33c186b952.tar.xz
yuzu-722195cf704a628aa13c5a178a07dd33c186b952.tar.zst
yuzu-722195cf704a628aa13c5a178a07dd33c186b952.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/kernel.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index cac76a6ec..1249a4c96 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -195,9 +195,9 @@ struct KernelCore::Impl {
void InitializeSuspendThreads() {
for (s32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) {
- suspend_threads[core_id] = KThread::CreateWithKernel(system.Kernel());
- ASSERT(KThread::InitializeHighPriorityThread(system, suspend_threads[core_id], {}, {},
- core_id)
+ suspend_threads[core_id] = std::make_unique<KThread>(system.Kernel());
+ ASSERT(KThread::InitializeHighPriorityThread(system, suspend_threads[core_id].get(), {},
+ {}, core_id)
.IsSuccess());
suspend_threads[core_id]->SetName(fmt::format("SuspendThread:{}", core_id));
}
@@ -235,14 +235,14 @@ struct KernelCore::Impl {
// Gets the dummy KThread for the caller, allocating a new one if this is the first time
KThread* GetHostDummyThread() {
auto make_thread = [this]() {
- KThread* thread = KThread::CreateWithKernel(system.Kernel());
- ASSERT(KThread::InitializeDummyThread(thread).IsSuccess());
+ std::unique_ptr<KThread> thread = std::make_unique<KThread>(system.Kernel());
+ ASSERT(KThread::InitializeDummyThread(thread.get()).IsSuccess());
thread->SetName(fmt::format("DummyThread:{}", GetHostThreadId()));
- return thread;
+ return std::move(thread);
};
thread_local auto thread = make_thread();
- return thread;
+ return thread.get();
}
/// Registers a CPU core thread by allocating a host thread ID for it
@@ -661,7 +661,7 @@ struct KernelCore::Impl {
// the release of itself
std::unique_ptr<Common::ThreadWorker> service_thread_manager;
- std::array<KThread*, Core::Hardware::NUM_CPU_CORES> suspend_threads{};
+ std::array<std::unique_ptr<KThread>, Core::Hardware::NUM_CPU_CORES> suspend_threads;
std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES> interrupts{};
std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{};