mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-16 14:09:54 +00:00
npl/riot: init event queues detached and claim later
This commit is contained in:
committed by
Andrzej Kaczmarek
parent
5f691c966c
commit
28760d18dc
@@ -77,7 +77,7 @@ ble_npl_get_current_task_id(void)
|
||||
static inline void
|
||||
ble_npl_eventq_init(struct ble_npl_eventq *evq)
|
||||
{
|
||||
event_queue_init(&evq->q);
|
||||
event_queue_init_detached(&evq->q);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -91,6 +91,10 @@ ble_npl_eventq_get(struct ble_npl_eventq *evq, ble_npl_time_t tmo)
|
||||
{
|
||||
assert((tmo == 0) || (tmo == BLE_NPL_TIME_FOREVER));
|
||||
|
||||
if (evq->q.waiter == NULL) {
|
||||
event_queue_claim(&evq->q);
|
||||
}
|
||||
|
||||
if (tmo == 0) {
|
||||
return (struct ble_npl_event *)event_get(&evq->q);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user