summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/core_timing.cpp1
-rw-r--r--src/core/hle/kernel/kernel.cpp15
-rw-r--r--src/core/hle/kernel/thread.cpp8
-rw-r--r--src/yuzu/bootmanager.cpp6
4 files changed, 25 insertions, 5 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index c91ae9975..3438f79ce 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -61,6 +61,7 @@ void CoreTiming::Initialize(std::function<void(void)>&& on_thread_init_) {
61void CoreTiming::Shutdown() { 61void CoreTiming::Shutdown() {
62 paused = true; 62 paused = true;
63 shutting_down = true; 63 shutting_down = true;
64 pause_event.Set();
64 event.Set(); 65 event.Set();
65 timer_thread->join(); 66 timer_thread->join();
66 ClearPendingEvents(); 67 ClearPendingEvents();
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 2a1b91752..24da4367e 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -119,6 +119,7 @@ struct KernelCore::Impl {
119 119
120 void Initialize(KernelCore& kernel) { 120 void Initialize(KernelCore& kernel) {
121 Shutdown(); 121 Shutdown();
122 RegisterHostThread();
122 123
123 InitializePhysicalCores(); 124 InitializePhysicalCores();
124 InitializeSystemResourceLimit(kernel); 125 InitializeSystemResourceLimit(kernel);
@@ -135,6 +136,19 @@ struct KernelCore::Impl {
135 next_user_process_id = Process::ProcessIDMin; 136 next_user_process_id = Process::ProcessIDMin;
136 next_thread_id = 1; 137 next_thread_id = 1;
137 138
139 for (std::size_t i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) {
140 if (suspend_threads[i]) {
141 suspend_threads[i].reset();
142 }
143 }
144
145 for (std::size_t i = 0; i < cores.size(); i++) {
146 cores[i].Shutdown();
147 }
148 cores.clear();
149
150 registered_core_threads.reset();
151
138 process_list.clear(); 152 process_list.clear();
139 current_process = nullptr; 153 current_process = nullptr;
140 154
@@ -154,6 +168,7 @@ struct KernelCore::Impl {
154 cores.clear(); 168 cores.clear();
155 169
156 exclusive_monitor.reset(); 170 exclusive_monitor.reset();
171 host_thread_ids.clear();
157 } 172 }
158 173
159 void InitializePhysicalCores() { 174 void InitializePhysicalCores() {
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 1c32552b1..6f8e7a070 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -56,10 +56,12 @@ void Thread::Stop() {
56 Signal(); 56 Signal();
57 kernel.GlobalHandleTable().Close(global_handle); 57 kernel.GlobalHandleTable().Close(global_handle);
58 58
59 owner_process->UnregisterThread(this); 59 if (owner_process) {
60 owner_process->UnregisterThread(this);
60 61
61 // Mark the TLS slot in the thread's page as free. 62 // Mark the TLS slot in the thread's page as free.
62 owner_process->FreeTLSRegion(tls_address); 63 owner_process->FreeTLSRegion(tls_address);
64 }
63 } 65 }
64 global_handle = 0; 66 global_handle = 0;
65} 67}
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 468dde782..6fad01d50 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -89,8 +89,10 @@ void EmuThread::run() {
89 } 89 }
90 running_guard = false; 90 running_guard = false;
91 91
92 was_active = true; 92 if (!stop_run) {
93 emit DebugModeEntered(); 93 was_active = true;
94 emit DebugModeEntered();
95 }
94 } else if (exec_step) { 96 } else if (exec_step) {
95 UNIMPLEMENTED(); 97 UNIMPLEMENTED();
96 } else { 98 } else {