__thread_alloc_and_run()
- Find the free thread whose state is
THREAD_STATE_FREE
. - If found, set thread’s state to
THREAD_STATE_ACTIVE
. - Set the current thread ID (
l->curr_thread
) to the founded thread ID. - Call
init_regs()
to initialize the registers to be restored of the thread. thread->regs.epc
is set topc
.- Call thread_resume() to resume the thread.
__thread_alloc_and_run()c
Loading...