Calling malloc in the critical section may cause thread switching. Add a retry mechanism to handle the situation where other threads have been successfully expanded. Signed-off-by: yinshengkai <yinshengkai@xiaomi.com> Signed-off-by: ligd <liguiding1@xiaomi.com>