From 3e75175d0242090902e4b383086e3f5ac6cf3f73 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 3 Dec 2018 12:25:27 -0500 Subject: svc: Implement SetThreadActivity (thread suspension) --- src/core/hle/kernel/thread.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core/hle/kernel/thread.h') diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index d384d50db..268bf845b 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -44,6 +44,7 @@ enum ThreadProcessorId : s32 { enum class ThreadStatus { Running, ///< Currently running Ready, ///< Ready to run + Paused, ///< Paused by SetThreadActivity or debug WaitHLEEvent, ///< Waiting for hle event to finish WaitSleep, ///< Waiting due to a SleepThread SVC WaitIPC, ///< Waiting for the reply from an IPC request @@ -60,6 +61,11 @@ enum class ThreadWakeupReason { Timeout // The thread was woken up due to a wait timeout. }; +enum class ThreadActivity : u32 { + Normal = 0, + Paused = 1, +}; + class Thread final : public WaitObject { public: using TLSMemory = std::vector; @@ -370,6 +376,12 @@ public: return affinity_mask; } + ThreadActivity GetActivity() const { + return activity; + } + + void SetActivity(ThreadActivity value); + private: explicit Thread(KernelCore& kernel); ~Thread() override; @@ -438,6 +450,8 @@ private: TLSMemoryPtr tls_memory = std::make_shared(); std::string name; + + ThreadActivity activity = ThreadActivity::Normal; }; /** -- cgit v1.2.3