diff options
| author | 2016-03-21 02:48:40 -0400 | |
|---|---|---|
| committer | 2016-03-21 02:57:12 -0400 | |
| commit | 6b7ebb3f82ae9674f2a4d66e870a53102b412003 (patch) | |
| tree | 6b6f018c35d6c8245a2944bca6f5d1209410490b /src/core/hle/hle.cpp | |
| parent | Merge pull request #1302 from Subv/save_fix (diff) | |
| download | yuzu-6b7ebb3f82ae9674f2a4d66e870a53102b412003.tar.gz yuzu-6b7ebb3f82ae9674f2a4d66e870a53102b412003.tar.xz yuzu-6b7ebb3f82ae9674f2a4d66e870a53102b412003.zip | |
hle: Get rid of global access to g_reschedule
This shouldn't be directly exposed if there's already a partial API that operates on it.
We can just provide the rest of that API.
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 331b1b22a..3b1369800 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp | |||
| @@ -14,9 +14,13 @@ | |||
| 14 | 14 | ||
| 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 15 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 16 | 16 | ||
| 17 | namespace HLE { | 17 | namespace { |
| 18 | |||
| 19 | bool reschedule; ///< If true, immediately reschedules the CPU to a new thread | ||
| 18 | 20 | ||
| 19 | bool g_reschedule; ///< If true, immediately reschedules the CPU to a new thread | 21 | } |
| 22 | |||
| 23 | namespace HLE { | ||
| 20 | 24 | ||
| 21 | void Reschedule(const char *reason) { | 25 | void Reschedule(const char *reason) { |
| 22 | DEBUG_ASSERT_MSG(reason != nullptr && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); | 26 | DEBUG_ASSERT_MSG(reason != nullptr && strlen(reason) < 256, "Reschedule: Invalid or too long reason."); |
| @@ -29,13 +33,21 @@ void Reschedule(const char *reason) { | |||
| 29 | 33 | ||
| 30 | Core::g_app_core->PrepareReschedule(); | 34 | Core::g_app_core->PrepareReschedule(); |
| 31 | 35 | ||
| 32 | g_reschedule = true; | 36 | reschedule = true; |
| 37 | } | ||
| 38 | |||
| 39 | bool RescheduleIsPending() { | ||
| 40 | return reschedule; | ||
| 41 | } | ||
| 42 | |||
| 43 | void DoneRescheduling() { | ||
| 44 | reschedule = false; | ||
| 33 | } | 45 | } |
| 34 | 46 | ||
| 35 | void Init() { | 47 | void Init() { |
| 36 | Service::Init(); | 48 | Service::Init(); |
| 37 | 49 | ||
| 38 | g_reschedule = false; | 50 | reschedule = false; |
| 39 | 51 | ||
| 40 | LOG_DEBUG(Kernel, "initialized OK"); | 52 | LOG_DEBUG(Kernel, "initialized OK"); |
| 41 | } | 53 | } |