Thread: Rename thread_queue => thread_list

This commit is contained in:
Yuri Kunde Schlesner 2014-12-29 11:32:05 -02:00
parent b0d9242bc7
commit 32ce2b92c7

View File

@ -37,7 +37,7 @@ ResultVal<bool> Thread::WaitSynchronization() {
} }
// Lists all thread ids that aren't deleted/etc. // Lists all thread ids that aren't deleted/etc.
static std::vector<std::shared_ptr<Thread>> thread_queue; static std::vector<std::shared_ptr<Thread>> thread_list;
// Lists only ready thread ids. // Lists only ready thread ids.
static Common::ThreadQueueList<Thread*> thread_ready_queue; static Common::ThreadQueueList<Thread*> thread_ready_queue;
@ -144,7 +144,7 @@ Thread* ArbitrateHighestPriorityThread(Object* arbiter, u32 address) {
s32 priority = THREADPRIO_LOWEST; s32 priority = THREADPRIO_LOWEST;
// Iterate through threads, find highest priority thread that is waiting to be arbitrated... // Iterate through threads, find highest priority thread that is waiting to be arbitrated...
for (auto& thread : thread_queue) { for (auto& thread : thread_list) {
if (!CheckWaitType(thread.get(), WAITTYPE_ARB, arbiter, address)) if (!CheckWaitType(thread.get(), WAITTYPE_ARB, arbiter, address))
continue; continue;
@ -169,7 +169,7 @@ Thread* ArbitrateHighestPriorityThread(Object* arbiter, u32 address) {
void ArbitrateAllThreads(Object* arbiter, u32 address) { void ArbitrateAllThreads(Object* arbiter, u32 address) {
// Iterate through threads, find highest priority thread that is waiting to be arbitrated... // Iterate through threads, find highest priority thread that is waiting to be arbitrated...
for (auto& thread : thread_queue) { for (auto& thread : thread_list) {
if (CheckWaitType(thread.get(), WAITTYPE_ARB, arbiter, address)) if (CheckWaitType(thread.get(), WAITTYPE_ARB, arbiter, address))
thread->ResumeFromWait(); thread->ResumeFromWait();
} }
@ -253,7 +253,7 @@ static void DebugThreadQueue() {
return; return;
} }
LOG_DEBUG(Kernel, "0x%02X 0x%08X (current)", thread->current_priority, GetCurrentThread()->GetHandle()); LOG_DEBUG(Kernel, "0x%02X 0x%08X (current)", thread->current_priority, GetCurrentThread()->GetHandle());
for (auto& t : thread_queue) { for (auto& t : thread_list) {
s32 priority = thread_ready_queue.contains(t.get()); s32 priority = thread_ready_queue.contains(t.get());
if (priority != -1) { if (priority != -1) {
LOG_DEBUG(Kernel, "0x%02X 0x%08X", priority, t->GetHandle()); LOG_DEBUG(Kernel, "0x%02X 0x%08X", priority, t->GetHandle());
@ -297,7 +297,7 @@ ResultVal<std::shared_ptr<Thread>> Thread::Create(const char* name, u32 entry_po
if (handle.Failed()) if (handle.Failed())
return handle.Code(); return handle.Code();
thread_queue.push_back(thread); thread_list.push_back(thread);
thread_ready_queue.prepare(priority); thread_ready_queue.prepare(priority);
thread->thread_id = next_thread_id++; thread->thread_id = next_thread_id++;
@ -380,7 +380,7 @@ void Reschedule() {
} else { } else {
LOG_TRACE(Kernel, "cannot context switch from 0x%08X, no higher priority thread!", prev->GetHandle()); LOG_TRACE(Kernel, "cannot context switch from 0x%08X, no higher priority thread!", prev->GetHandle());
for (auto& thread : thread_queue) { for (auto& thread : thread_list) {
LOG_TRACE(Kernel, "\thandle=0x%08X prio=0x%02X, status=0x%08X wait_type=0x%08X wait_handle=0x%08X", LOG_TRACE(Kernel, "\thandle=0x%08X prio=0x%02X, status=0x%08X wait_type=0x%08X wait_handle=0x%08X",
thread->GetHandle(), thread->current_priority, thread->status, thread->wait_type, thread->wait_object->GetHandle()); thread->GetHandle(), thread->current_priority, thread->status, thread->wait_type, thread->wait_object->GetHandle());
} }