| 115 | #endif |
| 116 | |
| 117 | static void _thread_exit(void) |
| 118 | { |
| 119 | struct rt_thread *thread; |
| 120 | rt_base_t critical_level; |
| 121 | |
| 122 | /* get current thread */ |
| 123 | thread = rt_thread_self(); |
| 124 | |
| 125 | critical_level = rt_enter_critical(); |
| 126 | |
| 127 | rt_thread_close(thread); |
| 128 | |
| 129 | _thread_detach_from_mutex(thread); |
| 130 | |
| 131 | /* insert to defunct thread list */ |
| 132 | rt_thread_defunct_enqueue(thread); |
| 133 | |
| 134 | rt_exit_critical_safe(critical_level); |
| 135 | |
| 136 | /* switch to next task */ |
| 137 | rt_schedule(); |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * @brief This function is the timeout function for thread, normally which is invoked |
nothing calls this directly
no test coverage detected