summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2014-12-29 11:32:05 -0200
committerGravatar Yuri Kunde Schlesner2015-01-09 04:02:17 -0200
commit7f1557fbbdd64784371f8299bce347c319004675 (patch)
tree9380c8048ab0887eed37631987864dee360b9e79 /src/core/hle/kernel/thread.cpp
parentThread: Reduce use of Handles and move some funcs to inside the class. (diff)
downloadyuzu-7f1557fbbdd64784371f8299bce347c319004675.tar.gz
yuzu-7f1557fbbdd64784371f8299bce347c319004675.tar.xz
yuzu-7f1557fbbdd64784371f8299bce347c319004675.zip
Thread: Rename thread_queue => thread_list
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
-rw-r--r--src/core/hle/kernel/thread.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 03244f013..16ceb7ac2 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -36,7 +36,7 @@ ResultVal<bool> Thread::WaitSynchronization() {
36} 36}
37 37
38// Lists all thread ids that aren't deleted/etc. 38// Lists all thread ids that aren't deleted/etc.
39static std::vector<Thread*> thread_queue; // TODO(yuriks): Owned 39static std::vector<Thread*> thread_list; // TODO(yuriks): Owned
40 40
41// Lists only ready thread ids. 41// Lists only ready thread ids.
42static Common::ThreadQueueList<Thread*, THREADPRIO_LOWEST+1> thread_ready_queue; 42static Common::ThreadQueueList<Thread*, THREADPRIO_LOWEST+1> thread_ready_queue;
@@ -143,7 +143,7 @@ Thread* ArbitrateHighestPriorityThread(Object* arbiter, u32 address) {
143 s32 priority = THREADPRIO_LOWEST; 143 s32 priority = THREADPRIO_LOWEST;
144 144
145 // Iterate through threads, find highest priority thread that is waiting to be arbitrated... 145 // Iterate through threads, find highest priority thread that is waiting to be arbitrated...
146 for (Thread* thread : thread_queue) { 146 for (Thread* thread : thread_list) {
147 if (!CheckWaitType(thread, WAITTYPE_ARB, arbiter, address)) 147 if (!CheckWaitType(thread, WAITTYPE_ARB, arbiter, address))
148 continue; 148 continue;
149 149
@@ -168,7 +168,7 @@ Thread* ArbitrateHighestPriorityThread(Object* arbiter, u32 address) {
168void ArbitrateAllThreads(Object* arbiter, u32 address) { 168void ArbitrateAllThreads(Object* arbiter, u32 address) {
169 169
170 // Iterate through threads, find highest priority thread that is waiting to be arbitrated... 170 // Iterate through threads, find highest priority thread that is waiting to be arbitrated...
171 for (Thread* thread : thread_queue) { 171 for (Thread* thread : thread_list) {
172 if (CheckWaitType(thread, WAITTYPE_ARB, arbiter, address)) 172 if (CheckWaitType(thread, WAITTYPE_ARB, arbiter, address))
173 thread->ResumeFromWait(); 173 thread->ResumeFromWait();
174 } 174 }
@@ -278,7 +278,7 @@ static void DebugThreadQueue() {
278 return; 278 return;
279 } 279 }
280 LOG_DEBUG(Kernel, "0x%02X 0x%08X (current)", thread->current_priority, GetCurrentThread()->GetHandle()); 280 LOG_DEBUG(Kernel, "0x%02X 0x%08X (current)", thread->current_priority, GetCurrentThread()->GetHandle());
281 for (Thread* t : thread_queue) { 281 for (Thread* t : thread_list) {
282 s32 priority = thread_ready_queue.contains(t); 282 s32 priority = thread_ready_queue.contains(t);
283 if (priority != -1) { 283 if (priority != -1) {
284 LOG_DEBUG(Kernel, "0x%02X 0x%08X", priority, t->GetHandle()); 284 LOG_DEBUG(Kernel, "0x%02X 0x%08X", priority, t->GetHandle());
@@ -324,7 +324,7 @@ ResultVal<Thread*> Thread::Create(const char* name, u32 entry_point, s32 priorit
324 if (handle.Failed()) 324 if (handle.Failed())
325 return handle.Code(); 325 return handle.Code();
326 326
327 thread_queue.push_back(thread); 327 thread_list.push_back(thread);
328 thread_ready_queue.prepare(priority); 328 thread_ready_queue.prepare(priority);
329 329
330 thread->thread_id = next_thread_id++; 330 thread->thread_id = next_thread_id++;
@@ -418,7 +418,7 @@ void Reschedule() {
418 } else { 418 } else {
419 LOG_TRACE(Kernel, "cannot context switch from 0x%08X, no higher priority thread!", prev->GetHandle()); 419 LOG_TRACE(Kernel, "cannot context switch from 0x%08X, no higher priority thread!", prev->GetHandle());
420 420
421 for (Thread* thread : thread_queue) { 421 for (Thread* thread : thread_list) {
422 LOG_TRACE(Kernel, "\thandle=0x%08X prio=0x%02X, status=0x%08X wait_type=0x%08X wait_handle=0x%08X", 422 LOG_TRACE(Kernel, "\thandle=0x%08X prio=0x%02X, status=0x%08X wait_type=0x%08X wait_handle=0x%08X",
423 thread->GetHandle(), thread->current_priority, thread->status, thread->wait_type, thread->wait_object->GetHandle()); 423 thread->GetHandle(), thread->current_priority, thread->status, thread->wait_type, thread->wait_object->GetHandle());
424 } 424 }