提交 7a6e4c81 编写于 作者: J JerryH1011

fix:修复共享内存shmat和shmdt接口之间存在的死锁问题

close #I40QOM

Change-Id: Ib3783f5d6b1095bf2100ab024fe0235a64355823
Signed-off-by: NJerryH1011 <huangjieliang@huawei.com>
上级 700c3415
...@@ -742,6 +742,7 @@ INT32 ShmDt(const VOID *shmaddr) ...@@ -742,6 +742,7 @@ INT32 ShmDt(const VOID *shmaddr)
/* remove it from aspace */ /* remove it from aspace */
LOS_RbDelNode(&space->regionRbTree, &region->rbNode); LOS_RbDelNode(&space->regionRbTree, &region->rbNode);
LOS_ArchMmuUnmap(&space->archMmu, region->range.base, region->range.size >> PAGE_SHIFT); LOS_ArchMmuUnmap(&space->archMmu, region->range.base, region->range.size >> PAGE_SHIFT);
(VOID)LOS_MuxRelease(&space->regionMux);
/* free it */ /* free it */
free(region); free(region);
...@@ -750,7 +751,7 @@ INT32 ShmDt(const VOID *shmaddr) ...@@ -750,7 +751,7 @@ INT32 ShmDt(const VOID *shmaddr)
if (seg == NULL) { if (seg == NULL) {
ret = EINVAL; ret = EINVAL;
SYSV_SHM_UNLOCK(); SYSV_SHM_UNLOCK();
goto ERROR_WITH_LOCK; goto ERROR;
} }
ShmPagesRefDec(seg); ShmPagesRefDec(seg);
...@@ -763,7 +764,7 @@ INT32 ShmDt(const VOID *shmaddr) ...@@ -763,7 +764,7 @@ INT32 ShmDt(const VOID *shmaddr)
seg->ds.shm_lpid = LOS_GetCurrProcessID(); seg->ds.shm_lpid = LOS_GetCurrProcessID();
} }
SYSV_SHM_UNLOCK(); SYSV_SHM_UNLOCK();
(VOID)LOS_MuxRelease(&space->regionMux);
return 0; return 0;
ERROR_WITH_LOCK: ERROR_WITH_LOCK:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册