uthread_resume这个函数里,有这么一段。 case SUSPEND: swapcontext(&(schedule.main),&(t->ctx)); 应该改成这样。 case SUSPEND: schedule.running_thread = id; swapcontext(&(schedule.main),&(t->ctx));