diff options
Diffstat (limited to 'components/libc/compilers')
| -rw-r--r-- | components/libc/compilers/common/cstdlib.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/libc/compilers/common/cstdlib.c b/components/libc/compilers/common/cstdlib.c index 9d1667b5d3..3ed5a228c8 100644 --- a/components/libc/compilers/common/cstdlib.c +++ b/components/libc/compilers/common/cstdlib.c @@ -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); |
