mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
mm/mempool: fix the entry condition for semaphore during mempool allocation
When the mempool uses the waitsem semaphore for memory allocation, the flowing two conditions must be satisfied simultaneously: its wait variable is set to true, and the expandsize variable is set to 0 Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
This commit is contained in:
parent
e3b1e5914e
commit
975968db1b
1 changed files with 1 additions and 0 deletions
|
|
@ -394,6 +394,7 @@ retry:
|
|||
blk = mempool_remove_queue(pool, &pool->queue);
|
||||
}
|
||||
else if (!pool->wait ||
|
||||
pool->expandsize > 0 ||
|
||||
nxsem_wait_uninterruptible(&pool->waitsem) < 0)
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue