diff options
Diffstat (limited to 'os/kernel/src/chthreads.c')
-rw-r--r-- | os/kernel/src/chthreads.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c index 583bc7c04..c18a4f8cd 100644 --- a/os/kernel/src/chthreads.c +++ b/os/kernel/src/chthreads.c @@ -290,6 +290,21 @@ void chThdSleepUntil(systime_t time) { chSysUnlock(); } +#if CH_USE_ROUNDROBIN +/** + * @brief Yields the time slot. + * @details Yields the CPU control to the next thread in the ready list with + * equal priority, if any. + */ +void chThdYield(void) { + + chSysLock(); + if (chSchCanYieldS()) + chSchDoRescheduleI(); + chSysUnlock(); +} +#endif /* CH_USE_ROUNDROBIN */ + /** * @brief Terminates the current thread by specifying an exit status code. * |