{
registerstructrt_thread*to_thread;registerrt_ubase_t highest_ready_priority;#ifRT_THREAD_PRIORITY_MAX >32registerrt_ubase_t number;
number =__rt_ffs(rt_thread_ready_priority_group)-1;
highest_ready_priority =(number <<3)+__rt_ffs(rt_thread_ready_table[number])-1;#else
highest_ready_priority =__rt_ffs(rt_thread_ready_priority_group)-1;#endif/* get switch to thread */
to_thread =rt_list_entry(rt_thread_priority_table[highest_ready_priority].next,structrt_thread,
tlist);
rt_current_thread = to_thread;/* switch to new thread */rt_hw_context_switch_to((rt_uint32_t)&to_thread->sp);/* never come back */}