Kernel: Remove Thread::wait_objects_index and use wait_objects to hold all the objects that a thread is waiting on.

This commit is contained in:
Subv 2017-01-04 10:53:01 -05:00
parent cef5f45de2
commit fd95b6ee26
4 changed files with 22 additions and 21 deletions

View file

@ -579,6 +579,11 @@ void Thread::SetWaitSynchronizationOutput(s32 output) {
context.cpu_registers[1] = output;
}
s32 Thread::GetWaitObjectIndex(WaitObject* object) const {
auto match = std::find(wait_objects.rbegin(), wait_objects.rend(), object);
return std::distance(match, wait_objects.rend()) - 1;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void ThreadingInit() {