mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-26 08:29:10 +12:00
Add arbiter sleeping with timeout
Update threads.cpp
This commit is contained in:
parent
54cdcacd5a
commit
456585a9e7
4 changed files with 51 additions and 13 deletions
|
@ -95,6 +95,8 @@ public:
|
|||
void signalArbiter(u32 waitingAddress, s32 threadCount);
|
||||
void sleepThread(s64 ns);
|
||||
void sleepThreadOnArbiter(u32 waitingAddress);
|
||||
void sleepThreadOnArbiterWithTimeout(u32 waitingAddress, s64 timeoutNs);
|
||||
|
||||
void switchThread(int newThreadIndex);
|
||||
void sortThreads();
|
||||
std::optional<int> getNextThread();
|
||||
|
|
|
@ -98,16 +98,17 @@ struct Session {
|
|||
};
|
||||
|
||||
enum class ThreadStatus {
|
||||
Running, // Currently running
|
||||
Ready, // Ready to run
|
||||
WaitArbiter, // Waiting on an address arbiter
|
||||
WaitSleep, // Waiting due to a SleepThread SVC
|
||||
WaitSync1, // Waiting for the single object in the wait list to be ready
|
||||
WaitSyncAny, // Wait for one object of the many that might be in the wait list to be ready
|
||||
WaitSyncAll, // Waiting for ALL sync objects in its wait list to be ready
|
||||
WaitIPC, // Waiting for the reply from an IPC request
|
||||
Dormant, // Created but not yet made ready
|
||||
Dead // Run to completion, or forcefully terminated
|
||||
Running, // Currently running
|
||||
Ready, // Ready to run
|
||||
WaitArbiter, // Waiting on an address arbiter
|
||||
WaitArbiterTimeout, // Waiting on an address arbiter with timeout
|
||||
WaitSleep, // Waiting due to a SleepThread SVC
|
||||
WaitSync1, // Waiting for the single object in the wait list to be ready
|
||||
WaitSyncAny, // Wait for one object of the many that might be in the wait list to be ready
|
||||
WaitSyncAll, // Waiting for ALL sync objects in its wait list to be ready
|
||||
WaitIPC, // Waiting for the reply from an IPC request
|
||||
Dormant, // Created but not yet made ready
|
||||
Dead // Run to completion, or forcefully terminated
|
||||
};
|
||||
|
||||
struct Thread {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue