* @brief Close a thread by setting its status to CLOSED * * @param thread The thread to be closed * @return rt_err_t Always returns RT_EOK on success * * @details This function: * - Requires scheduler lock to be held (RT_SCHED_DEBUG_IS_LOCKED) * - Sets the thread's status to RT_THREAD_CLOSE * * @note Must be called with scheduler lock held */
| 176 | * @note Must be called with scheduler lock held |
| 177 | */ |
| 178 | rt_err_t rt_sched_thread_close(struct rt_thread *thread) |
| 179 | { |
| 180 | RT_SCHED_DEBUG_IS_LOCKED; |
| 181 | RT_SCHED_CTX(thread).stat = RT_THREAD_CLOSE; |
| 182 | return RT_EOK; |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * @brief Yield the current thread's remaining time slice |