!438 解决shm接口死锁问题

Merge pull request !438 from JerryH/shm
This commit is contained in:
openharmony_ci 2021-07-21 01:50:28 +00:00 committed by Gitee
commit 3b9e3f8471
1 changed files with 3 additions and 2 deletions

View File

@ -742,6 +742,7 @@ INT32 ShmDt(const VOID *shmaddr)
/* remove it from aspace */
LOS_RbDelNode(&space->regionRbTree, &region->rbNode);
LOS_ArchMmuUnmap(&space->archMmu, region->range.base, region->range.size >> PAGE_SHIFT);
(VOID)LOS_MuxRelease(&space->regionMux);
/* free it */
free(region);
@ -750,7 +751,7 @@ INT32 ShmDt(const VOID *shmaddr)
if (seg == NULL) {
ret = EINVAL;
SYSV_SHM_UNLOCK();
goto ERROR_WITH_LOCK;
goto ERROR;
}
ShmPagesRefDec(seg);
@ -763,7 +764,7 @@ INT32 ShmDt(const VOID *shmaddr)
seg->ds.shm_lpid = LOS_GetCurrProcessID();
}
SYSV_SHM_UNLOCK();
(VOID)LOS_MuxRelease(&space->regionMux);
return 0;
ERROR_WITH_LOCK: