More thread work

This commit is contained in:
wheremyfoodat 2022-12-07 02:08:18 +02:00
parent 7547159a48
commit ca4726aba1
6 changed files with 82 additions and 28 deletions

View file

@ -60,6 +60,7 @@ private:
void switchToNextThread();
void rescheduleThreads();
bool canThreadRun(const Thread& t);
bool shouldWaitOnObject(KernelObject* object);
std::optional<Handle> getPortHandle(const char* name);
void deleteObjectData(KernelObject& object);

View file

@ -121,8 +121,12 @@ struct Thread {
u64 waitingNanoseconds;
// The tick this thread went to sleep on
u64 sleepTick;
// For WaitSynchronization: A vector of objects this thread is waiting for
// For WaitSynchronization(N): A vector of objects this thread is waiting for
std::vector<Handle> waitList;
// For WaitSynchronizationN: Shows whether the object should wait for all objects in the wait list or just one
bool waitAll;
// For WaitSynchronizationN: The "out" pointer
u32 outPointer;
// Thread context used for switching between threads
std::array<u32, 16> gprs;