diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-08-09 01:08:24 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-10 11:51:45 +0200 |
commit | bee08a4b9ff0f2c269a4e3a8159b689fbb8d1ab8 (patch) | |
tree | 7963eede850be6fcf18ac8b3aae30e72a8d30407 /Kernel/Thread.cpp | |
parent | 7bdf54c8372d6951409fae17dd4cec7eea6573a2 (diff) | |
download | serenity-bee08a4b9ff0f2c269a4e3a8159b689fbb8d1ab8.zip |
Kernel: More PID/TID typing
Diffstat (limited to 'Kernel/Thread.cpp')
-rw-r--r-- | Kernel/Thread.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp index d04a4dcc1d..196c6befa4 100644 --- a/Kernel/Thread.cpp +++ b/Kernel/Thread.cpp @@ -54,11 +54,10 @@ Thread::Thread(NonnullRefPtr<Process> process) // First thread gets TID == PID m_tid = m_process->pid().value(); } else { - // TODO: Use separate counter? m_tid = Process::allocate_pid().value(); } #ifdef THREAD_DEBUG - dbg() << "Created new thread " << m_process->name() << "(" << m_process->pid() << ":" << m_tid << ")"; + dbg() << "Created new thread " << m_process->name() << "(" << m_process->pid().value() << ":" << m_tid.value() << ")"; #endif set_default_signal_dispositions(); m_fpu_state = (FPUState*)kmalloc_aligned(sizeof(FPUState), 16); @@ -87,7 +86,7 @@ Thread::Thread(NonnullRefPtr<Process> process) m_tss.cr3 = m_process->page_directory().cr3(); - m_kernel_stack_region = MM.allocate_kernel_region(default_kernel_stack_size, String::format("Kernel Stack (Thread %d)", m_tid), Region::Access::Read | Region::Access::Write, false, true); + m_kernel_stack_region = MM.allocate_kernel_region(default_kernel_stack_size, String::format("Kernel Stack (Thread %d)", m_tid.value()), Region::Access::Read | Region::Access::Write, false, true); m_kernel_stack_region->set_stack(true); m_kernel_stack_base = m_kernel_stack_region->vaddr().get(); m_kernel_stack_top = m_kernel_stack_region->vaddr().offset(default_kernel_stack_size).get() & 0xfffffff8u; @@ -963,7 +962,7 @@ void Thread::wake_from_queue() set_state(State::Running); } -Thread* Thread::from_tid(int tid) +Thread* Thread::from_tid(ThreadID tid) { InterruptDisabler disabler; Thread* found_thread = nullptr; |