Cleanup Thread constructor
This commit is contained in:
parent
41d25a7b46
commit
d9b17d96d7
|
@ -27,7 +27,7 @@ Process::Process() : id_(gNextId++), state_(RUNNING) {
|
|||
}
|
||||
|
||||
SharedPtr<Thread> Process::CreateThread() {
|
||||
SharedPtr<Thread> thread{new Thread(*this, next_thread_id_++, 0)};
|
||||
SharedPtr<Thread> thread{new Thread(*this, next_thread_id_++)};
|
||||
threads_.PushBack(thread);
|
||||
return thread;
|
||||
}
|
||||
|
|
|
@ -24,8 +24,7 @@ SharedPtr<Thread> Thread::RootThread(Process& root_proc) {
|
|||
return new Thread(root_proc);
|
||||
}
|
||||
|
||||
Thread::Thread(Process& proc, uint64_t tid, uint64_t entry)
|
||||
: process_(proc), id_(tid), rip_(entry) {
|
||||
Thread::Thread(Process& proc, uint64_t tid) : process_(proc), id_(tid) {
|
||||
uint64_t* stack_ptr = proc.vmm().AllocateKernelStack();
|
||||
// 0: rip
|
||||
*(stack_ptr) = reinterpret_cast<uint64_t>(thread_init);
|
||||
|
|
|
@ -18,7 +18,7 @@ class Thread {
|
|||
};
|
||||
static SharedPtr<Thread> RootThread(Process& root_proc);
|
||||
|
||||
Thread(Process& proc, uint64_t tid, uint64_t entry);
|
||||
Thread(Process& proc, uint64_t tid);
|
||||
|
||||
uint64_t tid() const { return id_; };
|
||||
uint64_t pid() const;
|
||||
|
|
Loading…
Reference in New Issue