提交 ef37bf90 编写于 作者: O openharmony_ci 提交者: Gitee

!158 setitimer 创建的软件定时器,定时给进程发信号时,未加锁保护,导致踩内存等问题

Merge pull request !158 from zhushengle/master
...@@ -586,6 +586,7 @@ typedef struct { ...@@ -586,6 +586,7 @@ typedef struct {
static VOID SwtmrProc(UINTPTR tmrArg) static VOID SwtmrProc(UINTPTR tmrArg)
{ {
unsigned int intSave;
int sig; int sig;
pid_t pid; pid_t pid;
siginfo_t info; siginfo_t info;
...@@ -610,7 +611,10 @@ static VOID SwtmrProc(UINTPTR tmrArg) ...@@ -610,7 +611,10 @@ static VOID SwtmrProc(UINTPTR tmrArg)
info.si_value.sival_ptr = arg->sigev_value.sival_ptr; info.si_value.sival_ptr = arg->sigev_value.sival_ptr;
/* Send the signal */ /* Send the signal */
SCHEDULER_LOCK(intSave);
OsDispatch(pid, &info, OS_USER_KILL_PERMISSION); OsDispatch(pid, &info, OS_USER_KILL_PERMISSION);
SCHEDULER_UNLOCK(intSave);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册