mempool:fix bug when list needs to be protected by a lock
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
4ced3c9642
commit
7347684e5f
@ -394,6 +394,8 @@ int mempool_info(FAR struct mempool_s *pool, FAR struct mempoolinfo_s *info)
|
||||
int mempool_info_task(FAR struct mempool_s *pool,
|
||||
FAR struct mempoolinfo_task *info)
|
||||
{
|
||||
irqstate_t flags = spin_lock_irqsave(&pool->lock);
|
||||
|
||||
DEBUGASSERT(info);
|
||||
if (info->pid == -2)
|
||||
{
|
||||
@ -438,6 +440,7 @@ int mempool_info_task(FAR struct mempool_s *pool,
|
||||
}
|
||||
#endif
|
||||
|
||||
spin_unlock_irqrestore(&pool->lock, flags);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user