History log of /system/bt/osi/include/thread.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0035d8c9a8b50456f72874174857950df0ecfc67 03-May-2017 Philip Cuadra <philipcuadra@google.com> Revert "Revert "Make Bluetooth audio threads use RT scheduling""

This reverts commit feb2d84f4b69392b5f37ae1ec9d53ac728514275.

Bluetooth threads that are used in audio have deadline
requirements for glitchless playback. Those threads need to be
scheduled as RT tasks to ensure that they can meet the deadline even if
there is high system load.

Bug 37518404

Test: play Bluetooth audio, check for RT with systrace
(cherry picked from commit 96c42e70f5c6a74a737739aa9c297cd93540f43e)
/system/bt/osi/include/thread.h
feb2d84f4b69392b5f37ae1ec9d53ac728514275 28-Apr-2017 Philip Cuadra <philipcuadra@google.com> Revert "Make Bluetooth audio threads use RT scheduling"

This reverts commit eaa42774f393eb3ccaee91a958e8df6a8fb09b91.

http://b/37733903
Test: confirmed switching users does not hang.

Change-Id: Ic54e4ed2dda057e681df225a37a574c221cd8fc3
/system/bt/osi/include/thread.h
eaa42774f393eb3ccaee91a958e8df6a8fb09b91 23-Mar-2017 Philip Cuadra <philipcuadra@google.com> Make Bluetooth audio threads use RT scheduling

Bluetooth threads that are used in audio have deadline
requirements for glitchless playback. Those threads need to be
scheduled as RT tasks to ensure that they can meet the deadline even if
there is high system load.

Bug 37518404

Test: play Bluetooth audio, check for RT with systrace
Merged-In: I4505fbce55e5a4fe18d00dbda23646a60e482efd
Change-Id: I4505fbce55e5a4fe18d00dbda23646a60e482efd
(cherry picked from commit 96c42e70f5c6a74a737739aa9c297cd93540f43e)
/system/bt/osi/include/thread.h
ad1e23d50e431fb82ff1b8d3ce02f64ca0c5a940 10-Dec-2016 Jack He <siyuanh@google.com> Remove extern "C" from header files

Since change 290046, most files in system/bt is compiled as C++ source.
Therefore, there is no longer a need for the extern "C" wrapper around
includes that export symbols from those sources.

The following python script is applied to each file in the directory:

front = '#ifdef\s+__cplusplus\s+extern\s+"C"\s+{\s+#endif\s+'
back = '#ifdef\s+__cplusplus\s+}\s+#endif'
with open(sys.argv[1], "r") as f:
data = f.read()
data = re.sub(front, "", data)
data = re.sub(back, "", data)
print data

through a shell script:

for file in $(find . -name "*.h"); do
python remove_cpp_extern_c.py $file > tmp
cat tmp > $file
rm tmp
done

with following files not edited:
* stack/include/a2dp_*
* include/bt_trace.h
* embdrv/sbc/*

Bug: 33492510
Test: Code compilation, BtFunhausMetricsTest, BtStressTest
Change-Id: Iac21cdfb1924b50478dd0b82326e092602cbc9d4
/system/bt/osi/include/thread.h
b55040cc6448a8847490da807d2b6362aa8cb8d9 19-Oct-2016 Myles Watson <mylesgw@google.com> osi: Apply clang-format

cd osi/
clang-format -i --style=file include/*.h include/socket_utils/* src/*.cc \
src/socket_utils/* src/protos/* test/*

Test: mma -j32
Change-Id: I659e586076f1e2ec8f687cd33f441700b8d1f823
/system/bt/osi/include/thread.h
d19e0785e662e640191a075eda07acce61c2aeda 15-Jul-2016 Marie Janssen <jamuraa@google.com> Use standard types, consistent ifdef style everywhere

Remove the typedefs in stack/include/bt_types.h

Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Update script to be less disruptive to aligned assignment blocks.

Change-Id: I8f8f068e6c26ce74fd3b3707e1e31fd0b919cdd0
/system/bt/osi/include/thread.h
713993d1784ab7c23aee1fa3cf1ab8676cc0aa69 21-Apr-2016 Jakub Pawlowski <jpawlowski@google.com> Convert BTIF code from C to C++

Modifications required:
* added proper casting
* moved variable definitions before goto statements
* added 'extern "C"' markers where needed
* renamed 'operator' to 'operator_name'

Bug: 28485365
Change-Id: I903357967387207e678866c02e008f047f8263f6
/system/bt/osi/include/thread.h
78bcff79e1b1f0efce436b33bdd6da88745bfc8a 05-Dec-2015 Pavlin Radoslavov <pavlin@google.com> Refactor the Bluetooth timers

* Updated the alarm API:
- Existing API alarm_new() is modified to take an alarm name
as an argument.
- New API alarm_new_periodic() is used to create a periodic
alarm.
- Added new API alarm_is_scheduled() to test whether an alarm is
scheduled.
- Existing API alarm_set_periodic() is removed: a periodic
alarm is created by alarm_new_periodic().
- Added new API alarm_set_on_queue() to set an alarm whose
callback is executed on a specific queue.
- Added new API alarm_register_processing_queue() and
alarm_unregister_processing_queue() to register/unregister
a queue and the corresponding thread for alarm processing.
- Added corresponding unit tests.

* Updated the alarm internals:
- Added alarm_info_t for collecting alarm-related information
and statistics.
- Collect and store alarm-related statistics into alarm_info_t
per alarm.
- Include the alarm-related statistics and info into the native
dumpsys output for Bluetooth.
- Once an alarm expires, the alarm execution is scheduled for
processing on another internal alarm-specific thread, not
on the thread that is maintaining the alarms.
- Implemented callback execution ordering guarantee among
timers on the same thread with exactly same timeout values.

* Refactor some of the usage of alarm_set() and simplify the
code by using alarm_set_on_queue() instead.

* Removed the non_repeating timers wrapper, and use directly
the alarm mechanism / API.

* Refactored all timer_entry_t timers and replaced them with alarm_t
timers:
- Replaced the btu_start_timer() / btu_stop_timer() /
btu_start_quick_timer() / btu_stop_quick_timer() /
btu_oneshot_alarm() mechanism with alarm_set_on_queue() and
alarm_cancel()
- Removed the whole mechanism around the BTU_TTYPE_* timers.

* Fixed a bug when processing the GATT indication confirmation timer
expiration (timer tGATT_TCB.conf_timer: b/26610829).

* Renamed and/or split misc. timeout functions, fields, and timers

* Renamed time-related constants and changed the values from seconds
to milliseconds

* Replaced timer tAVDT_CCB.timer_entry with three mutually exclusive timers:
idle_ccb_timer, ret_ccb_timer, rsp_ccb_timer
The reason we are using three timers, is because in the original code
function avdt_ccb_chk_timer() used the timer type in its logic: it
would stop the timer only if the type is "idle".

* Removed btm_ble_timeout() and replaced it with multiple timeout
callback functions (per timer)

* Fix the actual value of the global constant BT_1SEC_TIMEOUT and
rename it to BT_1SEC_TIMEOUT_MS

* Removed btu_cb and associated timers and events, because they are
never used.

* Removed unused timers, functions, struct and declarations that are
not used / needed.

Bug: 26611369
Bug: 26610829

Change-Id: I812c8c31710a5daefc58b01fcf35c353768f390f
/system/bt/osi/include/thread.h
6c25b3c02c863cbb047e4cf8b4ec88d8335dac30 07-Oct-2015 Andre Eisenbach <eisenbach@google.com> Raise BTU and HCI thread priorities

The audio sub-system and audio related tasks run at elevated thread
priorities in order to ensure timely handling of audio packets. This
patch raises the thread priority of lower layer Bluetooth tasks involved
in delivering audio packets to avoid thread pre-emption and subsequent
audio skipping.

Bug: 24570959
Change-Id: I5e19ee4590207df753f7b8bfc22174959722ec2d
/system/bt/osi/include/thread.h
bc93d57e60d784ed78a9ae42e238a74d88267595 07-Jan-2015 Chris Manton <cmanton@google.com> Add size_t inclusion
/system/bt/osi/include/thread.h
44802768c447ab480d4227b3a852a97d923b816d 24-Dec-2014 Sharvil Nanavati <sharvil@google.com> Add platform-independent logging macros to OSI.

These macros should replace ALOG* and the various trace macros
used throughout bluedroid. This change eliminates all uses of the
ALOG* macros in favor of the new ones.
/system/bt/osi/include/thread.h
40fbe5de2fbbbd08e2dad4f1458cef291500fb20 16-Aug-2014 Zach Johnson <zachoverflow@google.com> Add a join function to thread
/system/bt/osi/include/thread.h
fbf89085bf308a98b00da77d1538539f6dd58604 13-Aug-2014 Sharvil Nanavati <sharvil@google.com> Switch to an epoll-based reactor implementation.

epoll is a much nicer interface that very closely matches the
reactor interface. It's also thread-safe which makes it a more
suitable choice for bluedroid. As a result of this change,
reactor_register and reactor_unregister are both thread-safe without
introducing any synchronization in user-space.
/system/bt/osi/include/thread.h
7c19f013b81edd43466ac88bf078cfdcf4ba534a 14-Aug-2014 Sharvil Nanavati <sharvil@google.com> Add thread_is_self function

This is useful to compare the current thread against another one.
/system/bt/osi/include/thread.h
7307d70bb66c451ed5a02f26d3add98eefd541a1 05-Aug-2014 Chris Manton <cmanton@google.com> Add fixed queue size option to thread creation
/system/bt/osi/include/thread.h
cc3306f36fc9b0fe6f93bf9003ee8759f78d1a1e 05-Aug-2014 Zach Johnson <zachoverflow@google.com> Hide thread's reactor
/system/bt/osi/include/thread.h
9d461af487359872d8abcfa23a0f8747f401a88f 24-Jul-2014 Sharvil Nanavati <sharvil@google.com> Expose thread's reactor so we can register new fds with it.

This change allows a thread's reactor loop to manage additional
file descriptors, e.g. sockets and queues, entirely within that
thread's context.
/system/bt/osi/include/thread.h
94347a59972868cf6d74f92cf793eb0b4b97c45a 05-Jul-2014 Sharvil Nanavati <sharvil.nanavati@gmail.com> Extend the threading library to back thread with an event queue.

This change allows arbitrary functions to be called on a given
thread which will clean up much of the dispatch code in bluedroid.
Looking forward, this code will be extended to allow additional objects
and queues to be attached to a thread for more customizable dispatch.

Change-Id: Id3a16256c264e3d35e6db5a562cb0e7762676457
/system/bt/osi/include/thread.h
118bdd58389c77dd69b37e377b4e98ea89d2b14e 08-May-2014 Sharvil Nanavati <sharvil@google.com> Start of threading library

So far it's a thin shim around pthreads which allows setting thread
name and querying tids from any thread.

Change-Id: Id156f662778806a54a8a302be424ee051fac4710
/system/bt/osi/include/thread.h