[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:
@@ -15,7 +15,7 @@ thread_create(void *rip, j6_handle_t *handle)
|
||||
|
||||
thread *child = p.create_thread();
|
||||
child->add_thunk_user(reinterpret_cast<uintptr_t>(rip));
|
||||
*handle = p.add_handle(child);
|
||||
*handle = p.self_handle();
|
||||
child->clear_state(thread::state::loading);
|
||||
child->set_state(thread::state::ready);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user