diff options
author | bunnei <bunneidev@gmail.com> | 2016-05-05 21:45:57 -0400 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2016-05-05 21:45:57 -0400 |
commit | 75cbfeee58cd3062cd097dbd355cbd51b840f326 (patch) | |
tree | f23ca2b0fc619b2648e3f298a18bfb15f3a8067a /src/core/hle/hle.cpp | |
parent | 55946cdc119c53656c79667b9a81172563b443ad (diff) | |
parent | 4cb2995c6159a5c6508ea0571ffa5fc5bcd21a47 (diff) |
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.cpp | 20 |
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 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -namespace HLE { +namespace { + +bool reschedule; ///< If true, immediately reschedules the CPU to a new thread -bool g_reschedule; ///< If true, immediately reschedules the CPU to a new thread +} + +namespace HLE { void Reschedule(const char *reason) { DEBUG_ASSERT_MSG(reason != nullptr && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); @@ -27,13 +31,21 @@ void Reschedule(const char *reason) { Core::g_app_core->PrepareReschedule(); - g_reschedule = true; + reschedule = true; +} + +bool IsReschedulePending() { + return reschedule; +} + +void DoneRescheduling() { + reschedule = false; } void Init() { Service::Init(); - g_reschedule = false; + reschedule = false; LOG_DEBUG(Kernel, "initialized OK"); } |