From 7c1a1566fde2bea141a0bace8053b332b56c49ec Mon Sep 17 00:00:00 2001 From: Reece Date: Sun, 30 Apr 2023 09:05:14 +0100 Subject: [PATCH] [*] missing tls impersonation in bd94b73d --- Source/Threading/Threads/AuOSThread.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Threading/Threads/AuOSThread.cpp b/Source/Threading/Threads/AuOSThread.cpp index 06e1ee1a..af2ed0f4 100644 --- a/Source/Threading/Threads/AuOSThread.cpp +++ b/Source/Threading/Threads/AuOSThread.cpp @@ -602,6 +602,7 @@ namespace Aurora::Threading::Threads static_cast(old)->OSDeatach(); } + auto uOldHandle = GetThreadKey(); this->OSAttach(); callback(); @@ -615,6 +616,8 @@ namespace Aurora::Threading::Threads { HandleRemove(); } + + SetThreadKey(uOldHandle); } void OSThread::UpdateName() @@ -724,6 +727,10 @@ namespace Aurora::Threading::Threads this->unixThreadId_ = 0; // !!!! #endif + if (this->tls_) + { + SetThreadKey(this->tls_); + } UpdatePrio(this->throttle_, this->prio_); SetAffinity(this->mask_); AffinityPrioThrottleTickAmendECores();