MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / __rt_libc_exit

Function __rt_libc_exit

components/libc/compilers/common/cstdlib.c:23–42  ·  view source on GitHub ↗

* @brief This function is called when a thread exits. It can detach the thread and perform cleanup. * * @param status is the exit status of the thread. */

Source from the content-addressed store, hash-verified

21 * @param status is the exit status of the thread.
22 */
23void __rt_libc_exit(int status)
24{
25 rt_thread_t self = rt_thread_self();
26
27 if (self != RT_NULL)
28 {
29 LOG_W("thread:%s exit:%d!", self->parent.name, status);
30#ifdef RT_USING_PTHREADS
31 if (self->pthread_data != RT_NULL)
32 {
33 extern void pthread_exit(void *value);
34 pthread_exit((void *)status);
35 }
36 else
37#endif
38 {
39 rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
40 }
41 }
42}
43
44#ifdef RT_USING_MSH
45/**

Callers 4

_exitFunction · 0.85
__exitFunction · 0.85
_sys_exitFunction · 0.85
_exitFunction · 0.85

Calls 3

rt_thread_selfFunction · 0.85
pthread_exitFunction · 0.85
rt_thread_controlFunction · 0.85

Tested by

no test coverage detected