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 | 2db5076ec9abab880ea2cc363f4e5e93c528d801 (patch) | |
| tree | a87668b7aab0bba9dd73dabf093b9f77b1ad6937 /src/core/hle/kernel/k_thread.cpp | |
| parent | c3c351e2c2e4f7fb3b4f822828709c30cadaada4 (diff) | |
| parent | e95bb782f08511cf6fa23c473e97c4861772dc39 (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 de3ffe0c7..ba7f72c6b 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(); } |
