diff options
| author | 2018-07-19 21:39:05 -0400 | |
|---|---|---|
| committer | 2018-07-19 22:08:56 -0400 | |
| commit | dbfe82773d98fadac481cd9061f5eda98aebf308 (patch) | |
| tree | ee1c5f480bcbf95339eff8677f061bbb57d8ee95 /src/core/hle/kernel/thread.h | |
| parent | Merge pull request #726 from lioncash/overload (diff) | |
| download | yuzu-dbfe82773d98fadac481cd9061f5eda98aebf308.tar.gz yuzu-dbfe82773d98fadac481cd9061f5eda98aebf308.tar.xz yuzu-dbfe82773d98fadac481cd9061f5eda98aebf308.zip | |
thread: Convert ThreadStatus into an enum class
Makes the thread status strongly typed, so implicit conversions can't
happen. It also makes it easier to catch mistakes at compile time.
Diffstat (limited to 'src/core/hle/kernel/thread.h')
| -rw-r--r-- | src/core/hle/kernel/thread.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index f1e759802..47881ec20 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -36,18 +36,18 @@ enum ThreadProcessorId : s32 { | |||
| 36 | (1 << THREADPROCESSORID_2) | (1 << THREADPROCESSORID_3) | 36 | (1 << THREADPROCESSORID_2) | (1 << THREADPROCESSORID_3) |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | enum ThreadStatus { | 39 | enum class ThreadStatus { |
| 40 | THREADSTATUS_RUNNING, ///< Currently running | 40 | Running, ///< Currently running |
| 41 | THREADSTATUS_READY, ///< Ready to run | 41 | Ready, ///< Ready to run |
| 42 | THREADSTATUS_WAIT_HLE_EVENT, ///< Waiting for hle event to finish | 42 | WaitHLEEvent, ///< Waiting for hle event to finish |
| 43 | THREADSTATUS_WAIT_SLEEP, ///< Waiting due to a SleepThread SVC | 43 | WaitSleep, ///< Waiting due to a SleepThread SVC |
| 44 | THREADSTATUS_WAIT_IPC, ///< Waiting for the reply from an IPC request | 44 | WaitIPC, ///< Waiting for the reply from an IPC request |
| 45 | THREADSTATUS_WAIT_SYNCH_ANY, ///< Waiting due to WaitSynch1 or WaitSynchN with wait_all = false | 45 | WaitSynchAny, ///< Waiting due to WaitSynch1 or WaitSynchN with wait_all = false |
| 46 | THREADSTATUS_WAIT_SYNCH_ALL, ///< Waiting due to WaitSynchronizationN with wait_all = true | 46 | WaitSynchAll, ///< Waiting due to WaitSynchronizationN with wait_all = true |
| 47 | THREADSTATUS_WAIT_MUTEX, ///< Waiting due to an ArbitrateLock/WaitProcessWideKey svc | 47 | WaitMutex, ///< Waiting due to an ArbitrateLock/WaitProcessWideKey svc |
| 48 | THREADSTATUS_WAIT_ARB, ///< Waiting due to a SignalToAddress/WaitForAddress svc | 48 | WaitArb, ///< Waiting due to a SignalToAddress/WaitForAddress svc |
| 49 | THREADSTATUS_DORMANT, ///< Created but not yet made ready | 49 | Dormant, ///< Created but not yet made ready |
| 50 | THREADSTATUS_DEAD ///< Run to completion, or forcefully terminated | 50 | Dead ///< Run to completion, or forcefully terminated |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | enum class ThreadWakeupReason { | 53 | enum class ThreadWakeupReason { |
| @@ -194,14 +194,14 @@ public: | |||
| 194 | * with wait_all = true. | 194 | * with wait_all = true. |
| 195 | */ | 195 | */ |
| 196 | bool IsSleepingOnWaitAll() const { | 196 | bool IsSleepingOnWaitAll() const { |
| 197 | return status == THREADSTATUS_WAIT_SYNCH_ALL; | 197 | return status == ThreadStatus::WaitSynchAll; |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | ARM_Interface::ThreadContext context; | 200 | ARM_Interface::ThreadContext context; |
| 201 | 201 | ||
| 202 | u32 thread_id; | 202 | u32 thread_id; |
| 203 | 203 | ||
| 204 | u32 status; | 204 | ThreadStatus status; |
| 205 | VAddr entry_point; | 205 | VAddr entry_point; |
| 206 | VAddr stack_top; | 206 | VAddr stack_top; |
| 207 | 207 | ||