| 796 | */ |
| 797 | rt_inline rt_noreturn |
| 798 | void _thread_exit(rt_lwp_t lwp, rt_thread_t thread) |
| 799 | { |
| 800 | LWP_LOCK(lwp); |
| 801 | lwp->rt_rusage.ru_stime.tv_sec += thread->system_time / RT_TICK_PER_SECOND; |
| 802 | lwp->rt_rusage.ru_stime.tv_usec += thread->system_time % RT_TICK_PER_SECOND * (1000000 / RT_TICK_PER_SECOND); |
| 803 | lwp->rt_rusage.ru_utime.tv_sec += thread->user_time / RT_TICK_PER_SECOND; |
| 804 | lwp->rt_rusage.ru_utime.tv_usec += thread->user_time % RT_TICK_PER_SECOND * (1000000 / RT_TICK_PER_SECOND); |
| 805 | rt_list_remove(&thread->sibling); |
| 806 | LWP_UNLOCK(lwp); |
| 807 | lwp_futex_exit_robust_list(thread); |
| 808 | |
| 809 | /** |
| 810 | * Note: the tid tree always hold a reference to thread, hence the tid must |
| 811 | * be release before cleanup of thread |
| 812 | */ |
| 813 | lwp_tid_put(thread->tid); |
| 814 | thread->tid = 0; |
| 815 | |
| 816 | rt_thread_delete(thread); |
| 817 | rt_schedule(); |
| 818 | while (1) ; |
| 819 | } |
| 820 | |
| 821 | /** |
| 822 | * @brief Clear child thread ID notification for parent process |
no test coverage detected