/* This function will let current thread yield processor, and scheduler will choose a highest thread to run. After yield processor, the current thread is still in READY state. */
rt_err_t rt_thread_yield(void)
/* This function will let current thread yield processor, and scheduler will choose a highest thread to run. After yield processor, the current thread is still in READY state. */
rt_err_t rt_thread_yield(void)
{
    struct rt_thread *thread;
    rt_base_t lock;
    thread = rt_thread_self();
    lock = rt_hw_interrupt_disable();
    thread->remaining_tick = thread->init_tick;
    thread->stat |= RT_THREAD_STAT_YIELD;
    rt_schedule();
    rt_hw_interrupt_enable(lock);
    return RT_EOK;
}