[kernel] Give processes and threads self handles

It was not consistent how processes got handles to themselves or their
threads, ending up with double entries. Now make such handles automatic
and expose them with new self_handle() methods.
This commit is contained in:
Justin C. Miller
2021-01-06 23:14:39 -08:00
parent 1325706c7c
commit 14ed6af433
6 changed files with 18 additions and 4 deletions

View File

@@ -26,6 +26,8 @@ thread::thread(process &parent, uint8_t pri, uintptr_t rsp0) :
setup_kernel_stack();
else
m_tcb.rsp0 = rsp0;
m_self_handle = parent.add_handle(this);
}
thread::~thread()