summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
authorxiangxistu <[email protected]>2022-08-08 11:16:17 +0800
committerGitHub <[email protected]>2022-08-07 23:16:17 -0400
commite61d05ca1a9e6b8a83c928ab1f893246629bbd2f (patch)
tree969c06f626d801311ea827bdd0c0e0bea878e7ef /src/thread.c
parent79934777d04eddc54f6e608398091aaef6cc2aa4 (diff)
[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".
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c
index eea42dab8e..f840fdd231 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -252,6 +252,10 @@ static rt_err_t _thread_init(struct rt_thread *thread,
thread->duration_tick = 0;
#endif /* RT_USING_CPU_USAGE */
+#ifdef RT_USING_PTHREADS
+ thread->pthread_data = RT_NULL;
+#endif /* RT_USING_PTHREADS */
+
#ifdef RT_USING_MODULE
thread->module_id = 0;
#endif /* RT_USING_MODULE */