summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-06-14 12:13:16 -0400
committerGravatar bunnei2014-06-14 12:13:16 -0400
commit004df767953a949817da89bddcd5d1379240f769 (patch)
treeb2d54928dcbf3cb4dde0cd5d3277afe7999b7bd9 /src/core/hle/kernel/kernel.cpp
parentGPU debugger: Const correctness and build fix. (diff)
parentKernel: Removed unnecessary "#pragma once". (diff)
downloadyuzu-004df767953a949817da89bddcd5d1379240f769.tar.gz
yuzu-004df767953a949817da89bddcd5d1379240f769.tar.xz
yuzu-004df767953a949817da89bddcd5d1379240f769.zip
Merge branch 'threading' of https://github.com/bunnei/citra
Conflicts: src/core/hle/function_wrappers.h src/core/hle/service/gsp.cpp
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index de80de893..cda183add 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -2,8 +2,6 @@
2// Licensed under GPLv2 2// Licensed under GPLv2
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#pragma once
6
7#include <string.h> 5#include <string.h>
8 6
9#include "common/common.h" 7#include "common/common.h"
@@ -14,6 +12,7 @@
14 12
15namespace Kernel { 13namespace Kernel {
16 14
15Handle g_main_thread = 0;
17ObjectPool g_object_pool; 16ObjectPool g_object_pool;
18 17
19ObjectPool::ObjectPool() { 18ObjectPool::ObjectPool() {
@@ -127,16 +126,20 @@ Object* ObjectPool::CreateByIDType(int type) {
127 126
128 default: 127 default:
129 ERROR_LOG(COMMON, "Unable to load state: could not find object type %d.", type); 128 ERROR_LOG(COMMON, "Unable to load state: could not find object type %d.", type);
130 return NULL; 129 return nullptr;
131 } 130 }
132} 131}
133 132
133/// Initialize the kernel
134void Init() { 134void Init() {
135 Kernel::ThreadingInit(); 135 Kernel::ThreadingInit();
136} 136}
137 137
138/// Shutdown the kernel
138void Shutdown() { 139void Shutdown() {
139 Kernel::ThreadingShutdown(); 140 Kernel::ThreadingShutdown();
141
142 g_object_pool.Clear(); // Free all kernel objects
140} 143}
141 144
142/** 145/**
@@ -150,7 +153,7 @@ bool LoadExec(u32 entry_point) {
150 Core::g_app_core->SetPC(entry_point); 153 Core::g_app_core->SetPC(entry_point);
151 154
152 // 0x30 is the typical main thread priority I've seen used so far 155 // 0x30 is the typical main thread priority I've seen used so far
153 Handle thread = Kernel::SetupMainThread(0x30); 156 g_main_thread = Kernel::SetupMainThread(0x30);
154 157
155 return true; 158 return true;
156} 159}