Merge pull request #1849 from encounter/svcSetThreadActivity
svc: Implement SetThreadActivity (thread suspension)
This commit is contained in:
commit
ae582b6669
5 changed files with 77 additions and 6 deletions
|
@ -45,6 +45,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
|
||||
|
@ -61,6 +62,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<u8>;
|
||||
|
@ -371,6 +377,12 @@ public:
|
|||
return affinity_mask;
|
||||
}
|
||||
|
||||
ThreadActivity GetActivity() const {
|
||||
return activity;
|
||||
}
|
||||
|
||||
void SetActivity(ThreadActivity value);
|
||||
|
||||
private:
|
||||
explicit Thread(KernelCore& kernel);
|
||||
~Thread() override;
|
||||
|
@ -439,6 +451,8 @@ private:
|
|||
TLSMemoryPtr tls_memory = std::make_shared<TLSMemory>();
|
||||
|
||||
std::string name;
|
||||
|
||||
ThreadActivity activity = ThreadActivity::Normal;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue