From 5333c30d45b3ca60247e382d020f21575a055bd8 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 20 Jan 2023 23:41:01 +0800 Subject: [PATCH] libc: abort should always call exit not pthread_exit since pthread_exit just exit the calling thread not the whole process Signed-off-by: Xiang Xiao --- libs/libc/stdlib/lib_abort.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/libs/libc/stdlib/lib_abort.c b/libs/libc/stdlib/lib_abort.c index 903e3f6223..663e224274 100644 --- a/libs/libc/stdlib/lib_abort.c +++ b/libs/libc/stdlib/lib_abort.c @@ -63,21 +63,8 @@ void abort(void) * a conformant version of abort() at this time. This version does not * signal the calling thread all. * - * Note that pthread_exit() is called instead of exit(). That is because - * we do no know if abort was called from a pthread or a normal thread - * (we could find out, of course). If abort() is called from a - * non-pthread, then pthread_exit() should fail and fall back to call - * exit() anyway. - * - * If exit() is called (either below or via pthread_exit()), then exit() - * will flush and close all open files and terminate the thread. If this - * function was called from a pthread, then pthread_exit() will complete - * any joins, but will not flush or close any streams. + * exit() will flush and close all open files and terminate the thread. */ -#ifdef CONFIG_DISABLE_PTHREAD exit(EXIT_FAILURE); -#else - pthread_exit(NULL); -#endif }