mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 19:44:24 +08:00
[fix] the risk for function exit() when open pthread support. (#6229)
* [fix] the risk for function exit() when open pthread support. * [update] modify annotation from "user data" to "pthread_data".
This commit is contained in:
@@ -21,8 +21,11 @@ void __rt_libc_exit(int status)
|
||||
if (self != RT_NULL)
|
||||
{
|
||||
#ifdef RT_USING_PTHREADS
|
||||
extern void pthread_exit(void *value);
|
||||
pthread_exit((void *)status);
|
||||
if(self->pthread_data != RT_NULL)
|
||||
{
|
||||
extern void pthread_exit(void *value);
|
||||
pthread_exit((void *)status);
|
||||
}
|
||||
#else
|
||||
LOG_E("thread:%s exit:%d!", self->name, status);
|
||||
rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
|
||||
|
||||
Reference in New Issue
Block a user