mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-10 22:47:58 -05:00
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.
This commit is contained in:
@ -62,6 +62,9 @@ enum class ThreadWakeupReason {
|
||||
|
||||
class Thread final : public WaitObject {
|
||||
public:
|
||||
using TLSMemory = std::vector<u8>;
|
||||
using TLSMemoryPtr = std::shared_ptr<TLSMemory>;
|
||||
|
||||
/**
|
||||
* 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<std::vector<u8>> tls_memory = std::make_shared<std::vector<u8>>();
|
||||
TLSMemoryPtr tls_memory = std::make_shared<TLSMemory>();
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user