diff options
| author | 2014-12-10 22:52:55 -0500 | |
|---|---|---|
| committer | 2014-12-10 22:52:55 -0500 | |
| commit | 3a75c8069e9c044f6a8f2fd80c7d35ea245a9f6e (patch) | |
| tree | 59d94738da7ef6f31ddbc8d4cbfbd58f578e25d8 /src/core/hle/kernel/thread.cpp | |
| parent | Merge pull request #239 from linkmauve/country-codes (diff) | |
| parent | Mutex: Remove some forward declarations (diff) | |
| download | yuzu-3a75c8069e9c044f6a8f2fd80c7d35ea245a9f6e.tar.gz yuzu-3a75c8069e9c044f6a8f2fd80c7d35ea245a9f6e.tar.xz yuzu-3a75c8069e9c044f6a8f2fd80c7d35ea245a9f6e.zip | |
Merge pull request #256 from Subv/mutex
Kernel/Mutex: Properly lock the mutex when a thread enters it
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) { |