Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
7442f620
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
8 个月 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
7442f620
编写于
4月 11, 2022
作者:
O
openharmony_ci
提交者:
Gitee
4月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
!280 fix: 修复kill进程导致死锁的问题
Merge pull request !280 from zhushengle/kill
上级
aef8fb77
eae5478e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
4 deletion
+40
-4
porting/liteos_a/user/src/exit/exit.c
porting/liteos_a/user/src/exit/exit.c
+8
-2
porting/liteos_a/user/src/stdio/__stdio_exit.c
porting/liteos_a/user/src/stdio/__stdio_exit.c
+24
-0
porting/liteos_a/user_debug/src/exit/exit.c
porting/liteos_a/user_debug/src/exit/exit.c
+8
-2
未找到文件。
porting/liteos_a/user/src/exit/exit.c
浏览文件 @
7442f620
...
...
@@ -3,7 +3,9 @@
#include <signal.h>
#include <atomic.h>
#include <pthread.h>
#include "syscall.h"
#include "libc.h"
#include <bits/errno.h>
pthread_mutex_t
__exit_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
...
...
@@ -33,9 +35,13 @@ _Noreturn void exit(int code)
{
sigset_t
set
;
pthread_mutex_lock
(
&
__exit_mutex
);
__block_app_sigs
(
&
set
);
int
ret
=
pthread_mutex_trylock
(
&
__exit_mutex
);
if
(
ret
==
EBUSY
)
{
pthread_exit
(
NULL
);
}
__funcs_on_exit
();
__libc_exit_fini
();
__stdio_exit
();
...
...
porting/liteos_a/user/src/stdio/__stdio_exit.c
0 → 100644
浏览文件 @
7442f620
#include "stdio_impl.h"
static
FILE
*
volatile
dummy_file
=
0
;
weak_alias
(
dummy_file
,
__stdin_used
);
weak_alias
(
dummy_file
,
__stdout_used
);
weak_alias
(
dummy_file
,
__stderr_used
);
static
void
close_file
(
FILE
*
f
)
{
if
(
!
f
)
return
;
if
(
f
->
wpos
!=
f
->
wbase
)
f
->
write
(
f
,
0
,
0
);
if
(
f
->
rpos
!=
f
->
rend
)
f
->
seek
(
f
,
f
->
rpos
-
f
->
rend
,
SEEK_CUR
);
}
void
__stdio_exit
(
void
)
{
FILE
*
f
;
for
(
f
=*
__ofl_lock
();
f
;
f
=
f
->
next
)
close_file
(
f
);
close_file
(
__stdin_used
);
close_file
(
__stdout_used
);
close_file
(
__stderr_used
);
}
weak_alias
(
__stdio_exit
,
__stdio_exit_needed
);
porting/liteos_a/user_debug/src/exit/exit.c
浏览文件 @
7442f620
...
...
@@ -5,7 +5,9 @@
#include <signal.h>
#include <atomic.h>
#include <pthread.h>
#include "syscall.h"
#include "libc.h"
#include <bits/errno.h>
extern
bool
g_enable_check
;
extern
void
mem_check_deinit
(
void
);
...
...
@@ -38,9 +40,13 @@ _Noreturn void exit(int code)
{
sigset_t
set
;
pthread_mutex_lock
(
&
__exit_mutex
);
__block_app_sigs
(
&
set
);
int
ret
=
pthread_mutex_trylock
(
&
__exit_mutex
);
if
(
ret
==
EBUSY
)
{
pthread_exit
(
NULL
);
}
if
(
g_enable_check
)
{
check_leak
();
check_heap_integrity
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录