diff options
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 1e879b45a..492b917e1 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "core/hle/hle.h" | 14 | #include "core/hle/hle.h" |
| 15 | #include "core/hle/kernel/kernel.h" | 15 | #include "core/hle/kernel/kernel.h" |
| 16 | #include "core/hle/kernel/thread.h" | 16 | #include "core/hle/kernel/thread.h" |
| 17 | #include "core/hle/kernel/mutex.h" | ||
| 17 | #include "core/hle/result.h" | 18 | #include "core/hle/result.h" |
| 18 | #include "core/mem_map.h" | 19 | #include "core/mem_map.h" |
| 19 | 20 | ||
| @@ -164,6 +165,9 @@ ResultCode StopThread(Handle handle, const char* reason) { | |||
| 164 | Thread* thread = g_object_pool.Get<Thread>(handle); | 165 | Thread* thread = g_object_pool.Get<Thread>(handle); |
| 165 | if (thread == nullptr) return InvalidHandle(ErrorModule::Kernel); | 166 | if (thread == nullptr) return InvalidHandle(ErrorModule::Kernel); |
| 166 | 167 | ||
| 168 | // Release all the mutexes that this thread holds | ||
| 169 | ReleaseThreadMutexes(handle); | ||
| 170 | |||
| 167 | ChangeReadyState(thread, false); | 171 | ChangeReadyState(thread, false); |
| 168 | thread->status = THREADSTATUS_DORMANT; | 172 | thread->status = THREADSTATUS_DORMANT; |
| 169 | for (Handle waiting_handle : thread->waiting_threads) { | 173 | for (Handle waiting_handle : thread->waiting_threads) { |