mirror of
https://github.com/apache/nuttx.git
synced 2026-03-23 22:43:57 +08: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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user