From acfc801d14b1883f54b8fe66ac428982f9898258 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 21 Sep 2018 01:26:29 -0400 Subject: thread/process: Move TLS slot marking/freeing to the process class Allows making several members of the process class private, it also avoids going through Core::CurrentProcess() just to retrieve the owning process. --- src/core/hle/kernel/thread.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/core/hle/kernel/thread.h') diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 91e9b79ec..4250144c3 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -62,6 +62,9 @@ enum class ThreadWakeupReason { class Thread final : public WaitObject { public: + using TLSMemory = std::vector; + using TLSMemoryPtr = std::shared_ptr; + /** * Creates and returns a new thread. The new thread is immediately scheduled * @param kernel The kernel instance this thread will be created under. @@ -134,6 +137,14 @@ public: return thread_id; } + TLSMemoryPtr& GetTLSMemory() { + return tls_memory; + } + + const TLSMemoryPtr& GetTLSMemory() const { + return tls_memory; + } + /** * Resumes a thread from waiting */ @@ -269,7 +280,7 @@ private: explicit Thread(KernelCore& kernel); ~Thread() override; - std::shared_ptr> tls_memory = std::make_shared>(); + TLSMemoryPtr tls_memory = std::make_shared(); }; /** -- cgit v1.2.3