提交 9a9a7174 编写于 作者: L liubb_0516

modify ipc resetipc

Signed-off-by: Nliubb_0516 <liubeibei8@huawei.com>
上级 c8ac14d9
......@@ -339,6 +339,7 @@ static void GetDeathCallback(IpcMsg* msg, HdlerArg* arg)
return;
}
arg->msg = msg;
arg->num = MAX_DEATH_CALLBACK_NUM;
(void)pthread_mutex_unlock(&g_ipcCallback.mutex);
}
......
......@@ -423,6 +423,20 @@ void DeleteDeathCallback(DeathCallback *deathCallback)
free(deathCallback);
}
static void DeleteAllNode(void)
{
(void)pthread_mutex_lock(&g_ipcSkeleton->lock);
DeathCallback *node = NULL;
DeathCallback *next = NULL;
UTILS_DL_LIST_FOR_EACH_ENTRY_SAFE(node, next, &g_ipcSkeleton->objects, DeathCallback, list)
{
pthread_mutex_destroy(&node->lock);
UtilsListDelete(&node->list);
free(node);
}
pthread_mutex_unlock(&g_ipcSkeleton->lock);
}
void ResetIpc(void)
{
RPC_LOG_INFO("ResetIpc called");
......@@ -430,6 +444,7 @@ void ResetIpc(void)
if (invoker != NULL && invoker->InvokerResetIpc != NULL) {
(invoker->InvokerResetIpc)();
}
DeleteAllNode();
#ifdef IPC_RESET_SKELETON
DeleteIpcSkeleton(g_ipcSkeleton);
g_ipcSkeleton = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册