summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/kernel.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2018-10-05 13:41:54 -0400
committerGravatar GitHub2018-10-05 13:41:54 -0400
commite51d715700a35a8f14e5b804b6f7553c9a40888b (patch)
tree96917effcab47b089718a90851b2b203717d324a /src/core/hle/kernel/kernel.cpp
parentMerge pull request #1442 from lioncash/format (diff)
parentkernel/thread: Make all instance variables private (diff)
downloadyuzu-e51d715700a35a8f14e5b804b6f7553c9a40888b.tar.gz
yuzu-e51d715700a35a8f14e5b804b6f7553c9a40888b.tar.xz
yuzu-e51d715700a35a8f14e5b804b6f7553c9a40888b.zip
Merge pull request #1439 from lioncash/thread
kernel/thread: Make all instance variables private
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r--src/core/hle/kernel/kernel.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 3e0800a71..98eb74298 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -46,40 +46,40 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] int cycles_
46 46
47 bool resume = true; 47 bool resume = true;
48 48
49 if (thread->status == ThreadStatus::WaitSynchAny || 49 if (thread->GetStatus() == ThreadStatus::WaitSynchAny ||
50 thread->status == ThreadStatus::WaitSynchAll || 50 thread->GetStatus() == ThreadStatus::WaitSynchAll ||
51 thread->status == ThreadStatus::WaitHLEEvent) { 51 thread->GetStatus() == ThreadStatus::WaitHLEEvent) {
52 // Remove the thread from each of its waiting objects' waitlists 52 // Remove the thread from each of its waiting objects' waitlists
53 for (auto& object : thread->wait_objects) { 53 for (const auto& object : thread->GetWaitObjects()) {
54 object->RemoveWaitingThread(thread.get()); 54 object->RemoveWaitingThread(thread.get());
55 } 55 }
56 thread->wait_objects.clear(); 56 thread->ClearWaitObjects();
57 57
58 // Invoke the wakeup callback before clearing the wait objects 58 // Invoke the wakeup callback before clearing the wait objects
59 if (thread->wakeup_callback) { 59 if (thread->HasWakeupCallback()) {
60 resume = thread->wakeup_callback(ThreadWakeupReason::Timeout, thread, nullptr, 0); 60 resume = thread->InvokeWakeupCallback(ThreadWakeupReason::Timeout, thread, nullptr, 0);
61 } 61 }
62 } 62 }
63 63
64 if (thread->mutex_wait_address != 0 || thread->condvar_wait_address != 0 || 64 if (thread->GetMutexWaitAddress() != 0 || thread->GetCondVarWaitAddress() != 0 ||
65 thread->wait_handle) { 65 thread->GetWaitHandle() != 0) {
66 ASSERT(thread->status == ThreadStatus::WaitMutex); 66 ASSERT(thread->GetStatus() == ThreadStatus::WaitMutex);
67 thread->mutex_wait_address = 0; 67 thread->SetMutexWaitAddress(0);
68 thread->condvar_wait_address = 0; 68 thread->SetCondVarWaitAddress(0);
69 thread->wait_handle = 0; 69 thread->SetWaitHandle(0);
70 70
71 auto lock_owner = thread->lock_owner; 71 auto* const lock_owner = thread->GetLockOwner();
72 // Threads waking up by timeout from WaitProcessWideKey do not perform priority inheritance 72 // Threads waking up by timeout from WaitProcessWideKey do not perform priority inheritance
73 // and don't have a lock owner unless SignalProcessWideKey was called first and the thread 73 // and don't have a lock owner unless SignalProcessWideKey was called first and the thread
74 // wasn't awakened due to the mutex already being acquired. 74 // wasn't awakened due to the mutex already being acquired.
75 if (lock_owner) { 75 if (lock_owner != nullptr) {
76 lock_owner->RemoveMutexWaiter(thread); 76 lock_owner->RemoveMutexWaiter(thread);
77 } 77 }
78 } 78 }
79 79
80 if (thread->arb_wait_address != 0) { 80 if (thread->GetArbiterWaitAddress() != 0) {
81 ASSERT(thread->status == ThreadStatus::WaitArb); 81 ASSERT(thread->GetStatus() == ThreadStatus::WaitArb);
82 thread->arb_wait_address = 0; 82 thread->SetArbiterWaitAddress(0);
83 } 83 }
84 84
85 if (resume) { 85 if (resume) {