* @brief This function will delete a thread. The thread object will be removed from * thread queue and deleted from system object management in the idle thread. * * @param thread Handle of the thread to be deleted. * * @return Return the operation status. If the return value is `RT_EOK`, the * function is successfully executed. * If the return value is any ot
| 598 | * If the return value is any other values, it means this operation failed. |
| 599 | */ |
| 600 | rt_err_t rt_thread_delete(rt_thread_t thread) |
| 601 | { |
| 602 | /* parameter check */ |
| 603 | RT_ASSERT(thread != RT_NULL); |
| 604 | RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread); |
| 605 | RT_ASSERT(rt_object_is_systemobject((rt_object_t)thread) == RT_FALSE); |
| 606 | |
| 607 | return _thread_detach(thread); |
| 608 | } |
| 609 | RTM_EXPORT(rt_thread_delete); |
| 610 | #endif /* RT_USING_HEAP */ |
| 611 |