* @brief Yield the current thread's remaining time slice * * @param thread The thread to yield * @return rt_err_t Always returns RT_EOK on success * * @details This function: * - Requires scheduler lock to be held (RT_SCHED_DEBUG_IS_LOCKED) * - Resets the thread's remaining tick count to its initial value * - Sets the thread's status to YIELD state * * @note Must be called with sch
| 196 | * @note Must be called with scheduler lock held |
| 197 | */ |
| 198 | rt_err_t rt_sched_thread_yield(struct rt_thread *thread) |
| 199 | { |
| 200 | RT_SCHED_DEBUG_IS_LOCKED; |
| 201 | |
| 202 | RT_SCHED_PRIV(thread).remaining_tick = RT_SCHED_PRIV(thread).init_tick; |
| 203 | RT_SCHED_CTX(thread).stat |= RT_THREAD_STAT_YIELD; |
| 204 | |
| 205 | return RT_EOK; |
| 206 | } |
| 207 | |
| 208 | /** |
| 209 | * @brief Make a suspended thread ready for scheduling |
no outgoing calls
no test coverage detected