[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:
xiangxistu
2022-08-07 23:16:17 -04:00
committed by GitHub
parent 79934777d0
commit e61d05ca1a
4 changed files with 31 additions and 20 deletions
+5 -2
View File
@@ -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);