* @brief This function will detach a thread. The thread object will be removed from * thread queue and detached/deleted from the system object management. * * @param thread Handle of the thread to be deleted. The thread must be * initialized by `rt_thread_init()`. * * @return Return the operation status. If the return value is `RT_EOK`, the * function
| 483 | * If the return value is any other values, it means this operation failed. |
| 484 | */ |
| 485 | rt_err_t rt_thread_detach(rt_thread_t thread) |
| 486 | { |
| 487 | /* parameter check */ |
| 488 | RT_ASSERT(thread != RT_NULL); |
| 489 | RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread); |
| 490 | RT_ASSERT(rt_object_is_systemobject((rt_object_t)thread)); |
| 491 | |
| 492 | return _thread_detach(thread); |
| 493 | } |
| 494 | RTM_EXPORT(rt_thread_detach); |
| 495 | |
| 496 | static rt_err_t _thread_detach(rt_thread_t thread) |