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

Merge pull request !158 from zhushengle/master
This commit is contained in:
openharmony_ci 2021-04-20 08:20:07 +08:00 committed by Gitee
commit ef37bf9037
1 changed files with 4 additions and 0 deletions

View File

@ -586,6 +586,7 @@ typedef struct {
static VOID SwtmrProc(UINTPTR tmrArg)
{
unsigned int intSave;
int sig;
pid_t pid;
siginfo_t info;
@ -610,7 +611,10 @@ static VOID SwtmrProc(UINTPTR tmrArg)
info.si_value.sival_ptr = arg->sigev_value.sival_ptr;
/* Send the signal */
SCHEDULER_LOCK(intSave);
OsDispatch(pid, &info, OS_USER_KILL_PERMISSION);
SCHEDULER_UNLOCK(intSave);
return;
}