diff options
| author | Fernando S <fsahmkow27@gmail.com> | 2022-03-16 12:15:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-16 12:15:33 +0100 |
| commit | 35798baf47d6f9588150d7f9b9110ae6549d6053 (patch) | |
| tree | a87668b7aab0bba9dd73dabf093b9f77b1ad6937 /src/core/hle/kernel/k_thread.cpp | |
| parent | 387c4c4deea06e673d65f8d681adeb6dc9328410 (diff) | |
| parent | 1494a66aa3f6e76dac5543883ee361099b5e9b45 (diff) | |
Merge pull request #8013 from bunnei/kernel-slab-rework-v2
Kernel Memory Updates (Part 6): Use guest memory for slab heaps & update TLS.
Diffstat (limited to 'src/core/hle/kernel/k_thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/k_thread.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index de3ffe0c75..ba7f72c6bc 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp @@ -210,7 +210,7 @@ ResultCode KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_s if (owner != nullptr) { // Setup the TLS, if needed. if (type == ThreadType::User) { - tls_address = owner->CreateTLSRegion(); + R_TRY(owner->CreateThreadLocalRegion(std::addressof(tls_address))); } parent = owner; @@ -305,7 +305,7 @@ void KThread::Finalize() { // If the thread has a local region, delete it. if (tls_address != 0) { - parent->FreeTLSRegion(tls_address); + ASSERT(parent->DeleteThreadLocalRegion(tls_address).IsSuccess()); } // Release any waiters. @@ -326,6 +326,9 @@ void KThread::Finalize() { } } + // Release host emulation members. + host_context.reset(); + // Perform inherited finalization. KSynchronizationObject::Finalize(); } |
