Merge branch 'fixed_queue_v4.0' into 'release/v4.0'

component_bt/: Fix_pointer_type_fixed_queue v4.0

See merge request espressif/esp-idf!6846
This commit is contained in:
Jiang Jiang Jian 2019-11-27 16:39:51 +08:00
commit 48dfbe05a4

View File

@ -152,7 +152,7 @@ void *fixed_queue_dequeue(fixed_queue_t *queue, uint32_t timeout)
assert(queue != NULL); assert(queue != NULL);
if (osi_sem_take(queue->dequeue_sem, timeout) != 0) { if (osi_sem_take(&queue->dequeue_sem, timeout) != 0) {
return NULL; return NULL;
} }
@ -206,14 +206,14 @@ void *fixed_queue_try_remove_from_queue(fixed_queue_t *queue, void *data)
osi_mutex_lock(&queue->lock, OSI_MUTEX_MAX_TIMEOUT); osi_mutex_lock(&queue->lock, OSI_MUTEX_MAX_TIMEOUT);
if (list_contains(queue->list, data) && if (list_contains(queue->list, data) &&
osi_sem_take(queue->dequeue_sem, 0) == 0) { osi_sem_take(&queue->dequeue_sem, 0) == 0) {
removed = list_remove(queue->list, data); removed = list_remove(queue->list, data);
assert(removed); assert(removed);
} }
osi_mutex_unlock(&queue->lock); osi_mutex_unlock(&queue->lock);
if (removed) { if (removed) {
osi_sem_give(queue->enqueue_sem); osi_sem_give(&queue->enqueue_sem);
return data; return data;
} }