1
0
Fork 0
forked from nuttx/nuttx-update

bluetooth: fix bt_slip_send would always block

rootcause: semcount maybe zero when nxsem_wait_uninterruptible

Signed-off-by: chengkai <chengkai@xiaomi.com>
This commit is contained in:
chengkai 2024-05-24 16:11:06 +08:00 committed by Xiang Xiao
parent 00eb8f6461
commit aeb3051aba

View file

@ -558,8 +558,8 @@ static void bt_slip_unack_handle(FAR struct sliphci_s *priv)
{
int semcount;
nxsem_get_value(&priv->sem, &semcount);
if (semcount < 0)
while (nxsem_get_value(&priv->sem, &semcount) >= 0 &&
semcount <= 0)
{
nxsem_post(&priv->sem);
}