diff options
| author | 2014-12-07 15:44:21 -0500 | |
|---|---|---|
| committer | 2014-12-07 15:44:21 -0500 | |
| commit | 64128aa61a7ada0744f801df116dfbe229a50382 (patch) | |
| tree | c22742e84c584242f38926307aad471a952ca723 /src/core/hle/kernel/thread.cpp | |
| parent | Mutex: Properly lock the mutex when a thread enters it (diff) | |
| download | yuzu-64128aa61a7ada0744f801df116dfbe229a50382.tar.gz yuzu-64128aa61a7ada0744f801df116dfbe229a50382.tar.xz yuzu-64128aa61a7ada0744f801df116dfbe229a50382.zip | |
Mutex: Release all held mutexes when a thread exits.
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 8d65dc84d..c01d76e4d 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 | ||
| @@ -156,6 +157,9 @@ ResultCode StopThread(Handle handle, const char* reason) { | |||
| 156 | Thread* thread = g_object_pool.Get<Thread>(handle); | 157 | Thread* thread = g_object_pool.Get<Thread>(handle); |
| 157 | if (thread == nullptr) return InvalidHandle(ErrorModule::Kernel); | 158 | if (thread == nullptr) return InvalidHandle(ErrorModule::Kernel); |
| 158 | 159 | ||
| 160 | // Release all the mutexes that this thread holds | ||
| 161 | ReleaseThreadMutexes(handle); | ||
| 162 | |||
| 159 | ChangeReadyState(thread, false); | 163 | ChangeReadyState(thread, false); |
| 160 | thread->status = THREADSTATUS_DORMANT; | 164 | thread->status = THREADSTATUS_DORMANT; |
| 161 | for (Handle waiting_handle : thread->waiting_threads) { | 165 | for (Handle waiting_handle : thread->waiting_threads) { |