summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHanhui <sylixos@gmail.com>2019-05-13 11:37:10 (GMT)
committer Hanhui <sylixos@gmail.com>2019-04-18 15:50:22 (GMT)
commite89da1b7d67a595096a416744fad0b40a76083bb (patch)
tree68f356167fbc1851d1b6971ff9d9902a05b7a9e5
parent9c8b36c18958402f5c4565db454544f0104eed89 (diff)
downloadAIC-OS-e89da1b7d67a595096a416744fad0b40a76083bb.zip
Panic use SIGKILL signal.
-rw-r--r--SylixOS/kernel/show/ThreadShow.c1
-rw-r--r--SylixOS/lib/libc/error/lib_panic.c2
-rw-r--r--SylixOS/lib/libc/stdlib/lib_system.c19
3 files changed, 17 insertions, 5 deletions
diff --git a/SylixOS/kernel/show/ThreadShow.c b/SylixOS/kernel/show/ThreadShow.c
index 7994676..7c98f6d 100644
--- a/SylixOS/kernel/show/ThreadShow.c
+++ b/SylixOS/kernel/show/ThreadShow.c
@@ -492,7 +492,6 @@ VOID API_ThreadPendShow (VOID)
{
API_ThreadPendShowEx(PX_ERROR); /* 显示所有线程 */
}
-
/*********************************************************************************************************
** 函数名称: API_ThreadWjShow
** 功能描述: 显示已经删除但未被 join 的线程信息
diff --git a/SylixOS/lib/libc/error/lib_panic.c b/SylixOS/lib/libc/error/lib_panic.c
index f87f632..146db8e 100644
--- a/SylixOS/lib/libc/error/lib_panic.c
+++ b/SylixOS/lib/libc/error/lib_panic.c
@@ -49,7 +49,7 @@ void panic (const char *pcFormat, ...)
/* (LW_CFG_FIO_LIB_EN > 0) */
if (getpid() > 0) { /* 进程内 panic */
#if LW_CFG_SIGNAL_EN > 0
- kill(getpid(), SIGABRT);
+ kill(getpid(), SIGKILL);
#endif /* LW_CFG_SIGNAL_EN > 0 */
API_ThreadForceDelete(&ulMe, (PVOID)EXIT_FAILURE);
diff --git a/SylixOS/lib/libc/stdlib/lib_system.c b/SylixOS/lib/libc/stdlib/lib_system.c
index a586a90..3600f4b 100644
--- a/SylixOS/lib/libc/stdlib/lib_system.c
+++ b/SylixOS/lib/libc/stdlib/lib_system.c
@@ -34,16 +34,29 @@
*********************************************************************************************************/
VOID lib_abort (VOID)
{
- LW_OBJECT_HANDLE ulMe = API_ThreadIdSelf();
+ LW_OBJECT_HANDLE ulMe;
#if LW_CFG_SIGNAL_EN > 0
- if (getpid() > 0) {
- kill(getpid(), SIGABRT);
+ pid_t pidMe;
+
+ pidMe = getpid();
+ if (pidMe > 0) {
+ kill(pidMe, SIGABRT);
+ } else {
+ raise(SIGABRT);
+ }
+
+ sleep(1);
+ signal(SIGABRT, SIG_DFL);
+
+ if (pidMe > 0) {
+ kill(pidMe, SIGABRT);
} else {
raise(SIGABRT);
}
#endif /* LW_CFG_SIGNAL_EN > 0 */
+ ulMe = API_ThreadIdSelf();
API_ThreadForceDelete(&ulMe, (PVOID)EXIT_FAILURE);
}
/*********************************************************************************************************