OSDN Git Service

Clean up messy dispatch in bt_hci_bdroid by using new primitives.
authorSharvil Nanavati <sharvil@google.com>
Sun, 6 Jul 2014 04:21:38 +0000 (21:21 -0700)
committerSharvil Nanavati <sharvil@google.com>
Wed, 16 Jul 2014 21:02:12 +0000 (14:02 -0700)
commit3f9fbe74c1d6e774d3f21275515c7b895715aec5
treea9bc2e4cbc30b6617982f66c49c5792477942eed
parent94347a59972868cf6d74f92cf793eb0b4b97c45a
Clean up messy dispatch in bt_hci_bdroid by using new primitives.

Instead of dispatching onto a worker thread by setting bits of a
bitfield and then having the thread pull data from shared data
structures, this code uses the previously defined primitives to
write to a synchronized thread event queue. It's advantageous because
it's more direct dispatch (you specify which function you want to
call on the worker thread instead of mapping bitfields to a function),
it avoids a lot of boilerplate code, function calls have predictable
ordering, and it uses generic infrastructure instead of building a
custom dispatch + synchronized data strucures.

Change-Id: If938e4fd47c8ddf328a29d104151f900ec659588
hci/include/bt_hci_bdroid.h
hci/include/btsnoop.h
hci/src/bt_hci_bdroid.c
hci/src/hci_h4.c
hci/src/hci_mct.c
hci/src/lpm.c
hci/src/userial.c
hci/src/userial_mct.c
hci/src/vendor.c