summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/thread.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-20 23:53:48 +0100
committerLioncash <mathew1800@gmail.com>2019-04-02 06:48:40 +0200
commit28719ee3b4884d182126bddf639e1711b0744b22 (patch)
tree3c8f4310e23117c330979c2c149d24a82104f04c /src/core/hle/kernel/thread.cpp
parentkernel/svc: Implement svcGetProcessList (diff)
downloadyuzu-28719ee3b4884d182126bddf639e1711b0744b22.tar
yuzu-28719ee3b4884d182126bddf639e1711b0744b22.tar.gz
yuzu-28719ee3b4884d182126bddf639e1711b0744b22.tar.bz2
yuzu-28719ee3b4884d182126bddf639e1711b0744b22.tar.lz
yuzu-28719ee3b4884d182126bddf639e1711b0744b22.tar.xz
yuzu-28719ee3b4884d182126bddf639e1711b0744b22.tar.zst
yuzu-28719ee3b4884d182126bddf639e1711b0744b22.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/thread.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index fa3ac3abc..3ec3710b2 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -62,6 +62,8 @@ void Thread::Stop() {
}
wait_objects.clear();
+ owner_process->UnregisterThread(this);
+
// Mark the TLS slot in the thread's page as free.
owner_process->FreeTLSSlot(tls_address);
}
@@ -202,6 +204,8 @@ ResultVal<SharedPtr<Thread>> Thread::Create(KernelCore& kernel, std::string name
thread->scheduler->AddThread(thread);
thread->tls_address = thread->owner_process->MarkNextAvailableTLSSlotAsUsed(*thread);
+ thread->owner_process->RegisterThread(thread.get());
+
// TODO(peachum): move to ScheduleThread() when scheduler is added so selected core is used
// to initialize the context
ResetThreadContext(thread->context, stack_top, entry_point, arg);