mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
fix(bt/bluedroid): Fixed deadlock caused by not unlocking
This commit is contained in:
committed by
Xiong Wei Chao
parent
230dbcb62c
commit
a3d2bf5f29
@@ -906,7 +906,6 @@ void btc_l2cap_cb_handler(btc_msg_t *msg)
|
|||||||
fixed_queue_enqueue(slot->rx.queue, p_data_buf, FIXED_QUEUE_MAX_TIMEOUT);
|
fixed_queue_enqueue(slot->rx.queue, p_data_buf, FIXED_QUEUE_MAX_TIMEOUT);
|
||||||
} else {
|
} else {
|
||||||
osi_free(p_data_buf);
|
osi_free(p_data_buf);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
|
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
|
||||||
@@ -950,7 +949,6 @@ void btc_l2cap_cb_handler(btc_msg_t *msg)
|
|||||||
fixed_queue_enqueue(slot->rx.queue, p_data_buf, FIXED_QUEUE_MAX_TIMEOUT);
|
fixed_queue_enqueue(slot->rx.queue, p_data_buf, FIXED_QUEUE_MAX_TIMEOUT);
|
||||||
} else {
|
} else {
|
||||||
osi_free(p_data_buf);
|
osi_free(p_data_buf);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
|
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
|
||||||
@@ -1060,7 +1058,7 @@ static ssize_t l2cap_vfs_write(int fd, const void * data, size_t size)
|
|||||||
if (!enqueue_status) {
|
if (!enqueue_status) {
|
||||||
BTC_TRACE_DEBUG("%s tx_len:%d, fd:%d\n", __func__, fixed_queue_length(slot->tx.queue), fd);
|
BTC_TRACE_DEBUG("%s tx_len:%d, fd:%d\n", __func__, fixed_queue_length(slot->tx.queue), fd);
|
||||||
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
|
osi_mutex_unlock(&l2cap_local_param.l2cap_slot_mutex);
|
||||||
//block untill under water level, be closed or time out
|
//block until under water level, be closed or time out
|
||||||
tx_event_group_val =
|
tx_event_group_val =
|
||||||
xEventGroupWaitBits(l2cap_local_param.tx_event_group, SLOT_WRITE_BIT(serial) | SLOT_CLOSE_BIT(serial), pdTRUE,
|
xEventGroupWaitBits(l2cap_local_param.tx_event_group, SLOT_WRITE_BIT(serial) | SLOT_CLOSE_BIT(serial), pdTRUE,
|
||||||
pdFALSE, VFS_WRITE_TIMEOUT / portTICK_PERIOD_MS);
|
pdFALSE, VFS_WRITE_TIMEOUT / portTICK_PERIOD_MS);
|
||||||
|
Reference in New Issue
Block a user