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:
parent
1db1e013e0
commit
acfc801d14
4 changed files with 89 additions and 68 deletions
|
@ -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>();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue