summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-11-07 07:07:56 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-11-07 07:07:56 -0800
commit492720c229ac4c79d7b95d197830ceb431d40cd2 (patch)
treeafa6d2b0fde0085f98f55ad348da0657cfc7d740
parent17749aa80ffeb9bb589f910818c8b215b31cbdc7 (diff)
parentaea16e4245353c9967d078a262c958ae47f65f03 (diff)
downloadandroid_system_bt-492720c229ac4c79d7b95d197830ceb431d40cd2.tar.gz
android_system_bt-492720c229ac4c79d7b95d197830ceb431d40cd2.tar.bz2
android_system_bt-492720c229ac4c79d7b95d197830ceb431d40cd2.zip
Merge "Revert "Fixed the problem that HCI command times out even without pending command.""
-rw-r--r--hci/src/hci_layer.c6
-rw-r--r--osi/src/list.c2
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;