[kernel] fix thread_create handle bug

thread_create was setting the handle it returned to be that of the
parent process, not the thread it created.
This commit is contained in:
Justin C. Miller
2021-01-18 18:24:18 -08:00
parent 9f342dff49
commit 0305830e32

View File

@@ -15,7 +15,7 @@ thread_create(void *rip, j6_handle_t *handle)
thread *child = p.create_thread(); thread *child = p.create_thread();
child->add_thunk_user(reinterpret_cast<uintptr_t>(rip)); child->add_thunk_user(reinterpret_cast<uintptr_t>(rip));
*handle = p.self_handle(); *handle = child->self_handle();
child->clear_state(thread::state::loading); child->clear_state(thread::state::loading);
child->set_state(thread::state::ready); child->set_state(thread::state::ready);