diff options
author | Fernando S <fsahmkow27@gmail.com> | 2022-06-16 02:41:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-16 02:41:12 +0200 |
commit | f86b770ff75efff029fa82b959b3f33eca1750fe (patch) | |
tree | 8c1aa046c96d7f943288ecb3455f4091cdc31a09 /src/core/hle/kernel/k_process.h | |
parent | Merge pull request #8460 from Morph1984/bounded-q (diff) | |
parent | kernel: implement KProcess suspension (diff) | |
download | yuzu-f86b770ff75efff029fa82b959b3f33eca1750fe.tar yuzu-f86b770ff75efff029fa82b959b3f33eca1750fe.tar.gz yuzu-f86b770ff75efff029fa82b959b3f33eca1750fe.tar.bz2 yuzu-f86b770ff75efff029fa82b959b3f33eca1750fe.tar.lz yuzu-f86b770ff75efff029fa82b959b3f33eca1750fe.tar.xz yuzu-f86b770ff75efff029fa82b959b3f33eca1750fe.tar.zst yuzu-f86b770ff75efff029fa82b959b3f33eca1750fe.zip |
Diffstat (limited to 'src/core/hle/kernel/k_process.h')
-rw-r--r-- | src/core/hle/kernel/k_process.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h index 9f171e3da..e562a79b8 100644 --- a/src/core/hle/kernel/k_process.h +++ b/src/core/hle/kernel/k_process.h @@ -63,6 +63,11 @@ enum class ProcessStatus { DebugBreak, }; +enum class ProcessActivity : u32 { + Runnable, + Paused, +}; + class KProcess final : public KAutoObjectWithSlabHeapAndContainer<KProcess, KWorkerTask> { KERNEL_AUTOOBJECT_TRAITS(KProcess, KSynchronizationObject); @@ -282,17 +287,17 @@ public: u64 GetTotalPhysicalMemoryUsedWithoutSystemResource() const; /// Gets the list of all threads created with this process as their owner. - const std::list<const KThread*>& GetThreadList() const { + std::list<KThread*>& GetThreadList() { return thread_list; } /// Registers a thread as being created under this process, /// adding it to this process' thread list. - void RegisterThread(const KThread* thread); + void RegisterThread(KThread* thread); /// Unregisters a thread from this process, removing it /// from this process' thread list. - void UnregisterThread(const KThread* thread); + void UnregisterThread(KThread* thread); /// Clears the signaled state of the process if and only if it's signaled. /// @@ -347,6 +352,8 @@ public: void DoWorkerTaskImpl(); + ResultCode SetActivity(ProcessActivity activity); + void PinCurrentThread(s32 core_id); void UnpinCurrentThread(s32 core_id); void UnpinThread(KThread* thread); @@ -442,7 +449,7 @@ private: std::array<u64, RANDOM_ENTROPY_SIZE> random_entropy{}; /// List of threads that are running with this process as their owner. - std::list<const KThread*> thread_list; + std::list<KThread*> thread_list; /// List of shared memory that are running with this process as their owner. std::list<KSharedMemoryInfo*> shared_memory_list; @@ -475,6 +482,7 @@ private: KThread* exception_thread{}; KLightLock state_lock; + KLightLock list_lock; using TLPTree = Common::IntrusiveRedBlackTreeBaseTraits<KThreadLocalPage>::TreeType<KThreadLocalPage>; |