mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 15:58:44 -05:00
core: hle: kernel: k_process: Implement thread local storage accurately.
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user