summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/mutex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
-rw-r--r--src/core/hle/kernel/mutex.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index 5a96d5e90..32dc1ffae 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -35,8 +35,6 @@ static std::pair<std::shared_ptr<Thread>, u32> GetHighestPriorityMutexWaitingThr
35 if (thread->GetMutexWaitAddress() != mutex_addr) 35 if (thread->GetMutexWaitAddress() != mutex_addr)
36 continue; 36 continue;
37 37
38 ASSERT(thread->GetStatus() == ThreadStatus::WaitMutex);
39
40 ++num_waiters; 38 ++num_waiters;
41 if (highest_priority_thread == nullptr || 39 if (highest_priority_thread == nullptr ||
42 thread->GetPriority() < highest_priority_thread->GetPriority()) { 40 thread->GetPriority() < highest_priority_thread->GetPriority()) {
@@ -50,6 +48,7 @@ static std::pair<std::shared_ptr<Thread>, u32> GetHighestPriorityMutexWaitingThr
50/// Update the mutex owner field of all threads waiting on the mutex to point to the new owner. 48/// Update the mutex owner field of all threads waiting on the mutex to point to the new owner.
51static void TransferMutexOwnership(VAddr mutex_addr, std::shared_ptr<Thread> current_thread, 49static void TransferMutexOwnership(VAddr mutex_addr, std::shared_ptr<Thread> current_thread,
52 std::shared_ptr<Thread> new_owner) { 50 std::shared_ptr<Thread> new_owner) {
51 current_thread->RemoveMutexWaiter(new_owner);
53 const auto threads = current_thread->GetMutexWaitingThreads(); 52 const auto threads = current_thread->GetMutexWaitingThreads();
54 for (const auto& thread : threads) { 53 for (const auto& thread : threads) {
55 if (thread->GetMutexWaitAddress() != mutex_addr) 54 if (thread->GetMutexWaitAddress() != mutex_addr)