MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_thread_yield

Function rt_thread_yield

src/thread.c:620–630  ·  view source on GitHub ↗

* @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

Source from the content-addressed store, hash-verified

618 * If the return value is any other values, it means this operation failed.
619 */
620rt_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}
631RTM_EXPORT(rt_thread_yield);
632
633/**

Callers 15

sys_sched_yieldFunction · 0.85
virtio_blk_rwFunction · 0.85
rt_pci_device_removeFunction · 0.85
nvme_submit_cmdFunction · 0.85
done_safelyFunction · 0.85
wait_safelyFunction · 0.85
done_safelyFunction · 0.85
wait_safelyFunction · 0.85

Calls 4

rt_sched_thread_yieldFunction · 0.85
rt_thread_selfFunction · 0.85
rt_sched_lockFunction · 0.70

Tested by 4

vector_childFunction · 0.68
test_contextFunction · 0.68
test_thread_yield_entryFunction · 0.68