summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/process.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-03-20 18:53:48 -0400
committerGravatar Lioncash2019-04-02 00:48:40 -0400
commit28719ee3b4884d182126bddf639e1711b0744b22 (patch)
tree3c8f4310e23117c330979c2c149d24a82104f04c /src/core/hle/kernel/process.cpp
parentkernel/svc: Implement svcGetProcessList (diff)
downloadyuzu-28719ee3b4884d182126bddf639e1711b0744b22.tar.gz
yuzu-28719ee3b4884d182126bddf639e1711b0744b22.tar.xz
yuzu-28719ee3b4884d182126bddf639e1711b0744b22.zip
kernel/svc: Implement svcGetThreadList
Similarly like svcGetProcessList, this retrieves the list of threads from the current process. In the kernel itself, a process instance maintains a list of threads, which are used within this function. Threads are registered to a process' thread list at thread initialization, and unregistered from the list upon thread destruction (if said thread has a non-null owning process). We assert on the debug event case, as we currently don't implement kernel debug objects.
Diffstat (limited to 'src/core/hle/kernel/process.cpp')
-rw-r--r--src/core/hle/kernel/process.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp
index 955769503..52f253d1e 100644
--- a/src/core/hle/kernel/process.cpp
+++ b/src/core/hle/kernel/process.cpp
@@ -80,6 +80,14 @@ u64 Process::GetTotalPhysicalMemoryUsed() const {
80 return vm_manager.GetCurrentHeapSize() + main_thread_stack_size + code_memory_size; 80 return vm_manager.GetCurrentHeapSize() + main_thread_stack_size + code_memory_size;
81} 81}
82 82
83void Process::RegisterThread(const Thread* thread) {
84 thread_list.push_back(thread);
85}
86
87void Process::UnregisterThread(const Thread* thread) {
88 thread_list.remove(thread);
89}
90
83ResultCode Process::ClearSignalState() { 91ResultCode Process::ClearSignalState() {
84 if (status == ProcessStatus::Exited) { 92 if (status == ProcessStatus::Exited) {
85 LOG_ERROR(Kernel, "called on a terminated process instance."); 93 LOG_ERROR(Kernel, "called on a terminated process instance.");