mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
[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:
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user