fix: 修复kill进程时,因liteipc阻塞的进程概率无法退出问题
kill进程时,会将因为liteipc阻塞的线程唤醒,使其调度并自动退出,由于liteipc阻塞机制为 循环阻塞方式,会导致将因liteipc阻塞的线程唤醒后又进入等待中。此处在唤醒因liteipc阻塞的 线程后检查是否已有kill标志,如果有使其按接收数据失败退出,在返回用户态之前,该线程会进 入退出流程,结束运行。 Close #I3XX7K Signed-off-by: zhushengle <zhushengle@huawei.com> Change-Id: Iec4e298dff4aefd2994289067a35cb5673e323f9
This commit is contained in:
parent
68da7aefc5
commit
7de43bb004
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue