summaryrefslogtreecommitdiff
path: root/src/core/hle/hle.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2016-05-05 21:45:57 -0400
committerGravatar bunnei2016-05-05 21:45:57 -0400
commit75cbfeee58cd3062cd097dbd355cbd51b840f326 (patch)
treef23ca2b0fc619b2648e3f298a18bfb15f3a8067a /src/core/hle/hle.cpp
parentMerge pull request #1700 from wwylele/gamelist-icon (diff)
parentHLE: Rename RescheduleIsPending to IsReschedulePending. (diff)
downloadyuzu-75cbfeee58cd3062cd097dbd355cbd51b840f326.tar.gz
yuzu-75cbfeee58cd3062cd097dbd355cbd51b840f326.tar.xz
yuzu-75cbfeee58cd3062cd097dbd355cbd51b840f326.zip
Merge pull request #1762 from bunnei/global
hle: Get rid of direct global access to g_reschedule
Diffstat (limited to 'src/core/hle/hle.cpp')
-rw-r--r--src/core/hle/hle.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp
index e545de3b5..5c5373517 100644
--- a/src/core/hle/hle.cpp
+++ b/src/core/hle/hle.cpp
@@ -12,9 +12,13 @@
12 12
13//////////////////////////////////////////////////////////////////////////////////////////////////// 13////////////////////////////////////////////////////////////////////////////////////////////////////
14 14
15namespace HLE { 15namespace {
16
17bool reschedule; ///< If true, immediately reschedules the CPU to a new thread
16 18
17bool g_reschedule; ///< If true, immediately reschedules the CPU to a new thread 19}
20
21namespace HLE {
18 22
19void Reschedule(const char *reason) { 23void Reschedule(const char *reason) {
20 DEBUG_ASSERT_MSG(reason != nullptr && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); 24 DEBUG_ASSERT_MSG(reason != nullptr && strlen(reason) < 256, "Reschedule: Invalid or too long reason.");
@@ -27,13 +31,21 @@ void Reschedule(const char *reason) {
27 31
28 Core::g_app_core->PrepareReschedule(); 32 Core::g_app_core->PrepareReschedule();
29 33
30 g_reschedule = true; 34 reschedule = true;
35}
36
37bool IsReschedulePending() {
38 return reschedule;
39}
40
41void DoneRescheduling() {
42 reschedule = false;
31} 43}
32 44
33void Init() { 45void Init() {
34 Service::Init(); 46 Service::Init();
35 47
36 g_reschedule = false; 48 reschedule = false;
37 49
38 LOG_DEBUG(Kernel, "initialized OK"); 50 LOG_DEBUG(Kernel, "initialized OK");
39} 51}