diff options
-rw-r--r-- | hci/src/hci_layer.c | 6 | ||||
-rw-r--r-- | osi/src/list.c | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/hci/src/hci_layer.c b/hci/src/hci_layer.c index a8f7ab3f0..e9acb2ce1 100644 --- a/hci/src/hci_layer.c +++ b/hci/src/hci_layer.c @@ -464,14 +464,14 @@ static void event_command_ready(fixed_queue_t *queue, UNUSED_ATTR void *context) // Move it to the list of commands awaiting response pthread_mutex_lock(&commands_pending_response_lock); list_append(commands_pending_response, wait_entry); - - non_repeating_timer_restart_if(command_response_timer, !list_is_empty(commands_pending_response)); pthread_mutex_unlock(&commands_pending_response_lock); // Send it off low_power_manager->wake_assert(); packet_fragmenter->fragment_and_dispatch(wait_entry->command); low_power_manager->transmit_done(); + + non_repeating_timer_restart_if(command_response_timer, !list_is_empty(commands_pending_response)); } } @@ -717,9 +717,7 @@ static bool filter_incoming_event(BT_HDR *packet) { return false; intercepted:; - pthread_mutex_lock(&commands_pending_response_lock); non_repeating_timer_restart_if(command_response_timer, !list_is_empty(commands_pending_response)); - pthread_mutex_unlock(&commands_pending_response_lock); if (wait_entry) { // If it has a callback, it's responsible for freeing the packet diff --git a/osi/src/list.c b/osi/src/list.c index 91836318b..6fbb69cd7 100644 --- a/osi/src/list.c +++ b/osi/src/list.c @@ -12,7 +12,7 @@ struct list_node_t { typedef struct list_t { list_node_t *head; list_node_t *tail; - volatile size_t length; + size_t length; list_free_cb free_cb; const allocator_t *allocator; } list_t; |