提交 50c8abc5 编写于 作者: O openharmony_ci 提交者: Gitee

!371 fix: 修复kill进程时,liteipc阻塞的进程无法退出问题

Merge pull request !371 from zhushengle/p_kill
......@@ -470,6 +470,15 @@ STATIC INLINE BOOL OsTaskIsPending(const LosTaskCB *taskCB)
return FALSE;
}
STATIC INLINE BOOL OsTaskIsKilled(const LosTaskCB *taskCB)
{
if (taskCB->taskStatus & OS_TASK_FLAG_EXIT_KILL) {
return TRUE;
}
return FALSE;
}
#define OS_TID_CHECK_INVALID(taskID) ((UINT32)(taskID) >= g_taskMaxNum)
/* get task info */
......
......@@ -108,6 +108,7 @@ typedef enum {
READ,
READ_DROP,
READ_TIMEOUT,
KILL,
OPERATION_NUM
} IpcOpertion;
......@@ -1099,6 +1100,14 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content)
return -ETIME;
}
if (OsTaskIsKilled(tcb)) {
#if (LOSCFG_KERNEL_TRACE == YES)
IpcTrace(NULL, KILL, tcb->ipcStatus, syncFlag ? MT_REPLY : MT_REQUEST);
#endif
SCHEDULER_UNLOCK(intSave);
return -ERFKILL;
}
SCHEDULER_UNLOCK(intSave);
} else {
listNode = LOS_DL_LIST_FIRST(listHead);
......@@ -1178,7 +1187,7 @@ BUFFER_FREE:
if ((content->flag & RECV) == RECV) {
ret = LiteIpcRead(content);
if (ret != LOS_OK) {
PRINT_ERR("LiteIpcRead failed\n");
PRINT_ERR("LiteIpcRead failed ERROR: %d\n", (INT32)ret);
return ret;
}
UINT32 offset = LOS_OFF_SET_OF(IpcContent, inMsg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册