diff options
| author | 2020-02-25 11:12:46 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:35:09 -0400 | |
| commit | dc580582034fb5937aa53176fdaa4bd0fc4acce8 (patch) | |
| tree | 6d351a6c3a76fee0a9bc1ab546d07c0583a9d9cd /src/core/cpu_manager.cpp | |
| parent | CPU_Manager: remove debugging code. (diff) | |
| download | yuzu-dc580582034fb5937aa53176fdaa4bd0fc4acce8.tar.gz yuzu-dc580582034fb5937aa53176fdaa4bd0fc4acce8.tar.xz yuzu-dc580582034fb5937aa53176fdaa4bd0fc4acce8.zip | |
General: Setup yuzu threads' microprofile, naming and registry.
Diffstat (limited to 'src/core/cpu_manager.cpp')
| -rw-r--r-- | src/core/cpu_manager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp index ff2fe8ead..9b9337131 100644 --- a/src/core/cpu_manager.cpp +++ b/src/core/cpu_manager.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "common/fiber.h" | 5 | #include "common/fiber.h" |
| 6 | #include "common/microprofile.h" | ||
| 6 | #include "common/thread.h" | 7 | #include "common/thread.h" |
| 7 | #include "core/arm/exclusive_monitor.h" | 8 | #include "core/arm/exclusive_monitor.h" |
| 8 | #include "core/core.h" | 9 | #include "core/core.h" |
| @@ -36,6 +37,7 @@ void CpuManager::Shutdown() { | |||
| 36 | Pause(false); | 37 | Pause(false); |
| 37 | for (std::size_t core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { | 38 | for (std::size_t core = 0; core < Core::Hardware::NUM_CPU_CORES; core++) { |
| 38 | core_data[core].host_thread->join(); | 39 | core_data[core].host_thread->join(); |
| 40 | core_data[core].host_thread.reset(); | ||
| 39 | } | 41 | } |
| 40 | } | 42 | } |
| 41 | 43 | ||
| @@ -80,7 +82,7 @@ void CpuManager::RunGuestThread() { | |||
| 80 | auto& physical_core = kernel.CurrentPhysicalCore(); | 82 | auto& physical_core = kernel.CurrentPhysicalCore(); |
| 81 | if (!physical_core.IsInterrupted()) { | 83 | if (!physical_core.IsInterrupted()) { |
| 82 | physical_core.Idle(); | 84 | physical_core.Idle(); |
| 83 | //physical_core.Run(); | 85 | // physical_core.Run(); |
| 84 | } | 86 | } |
| 85 | auto& scheduler = physical_core.Scheduler(); | 87 | auto& scheduler = physical_core.Scheduler(); |
| 86 | scheduler.TryDoContextSwitch(); | 88 | scheduler.TryDoContextSwitch(); |
| @@ -159,6 +161,7 @@ void CpuManager::RunThread(std::size_t core) { | |||
| 159 | /// Initialization | 161 | /// Initialization |
| 160 | system.RegisterCoreThread(core); | 162 | system.RegisterCoreThread(core); |
| 161 | std::string name = "yuzu:CoreHostThread_" + std::to_string(core); | 163 | std::string name = "yuzu:CoreHostThread_" + std::to_string(core); |
| 164 | MicroProfileOnThreadCreate(name.c_str()); | ||
| 162 | Common::SetCurrentThreadName(name.c_str()); | 165 | Common::SetCurrentThreadName(name.c_str()); |
| 163 | auto& data = core_data[core]; | 166 | auto& data = core_data[core]; |
| 164 | data.enter_barrier = std::make_unique<Common::Event>(); | 167 | data.enter_barrier = std::make_unique<Common::Event>(); |