* @brief This function will let current thread yield processor, and scheduler will * choose the highest thread to run. After yield processor, the current thread * is still in READY state. * * @return Return the operation status. If the return value is RT_EOK, the function is successfully executed. * If the return value is any other values, it means this operation
| 618 | * If the return value is any other values, it means this operation failed. |
| 619 | */ |
| 620 | rt_err_t rt_thread_yield(void) |
| 621 | { |
| 622 | rt_sched_lock_level_t slvl; |
| 623 | rt_sched_lock(&slvl); |
| 624 | |
| 625 | rt_sched_thread_yield(rt_thread_self()); |
| 626 | |
| 627 | rt_sched_unlock_n_resched(slvl); |
| 628 | |
| 629 | return RT_EOK; |
| 630 | } |
| 631 | RTM_EXPORT(rt_thread_yield); |
| 632 | |
| 633 | /** |