summaryrefslogtreecommitdiff
path: root/system/common/message_loop_thread_unittest.cc
AgeCommit message (Collapse)Author
2018-10-12Uprev libchrome to r576279 (1/multiple)Jakub Pawlowski
This patch brings the latest and greatest features of libchrome to android. It contains ~2600 patches. Reason for uprev: libbluetooth want to use some of the most recent features avaliable. Test: libchrome_test Change-Id: I5f8d5931b404767d3b86cb3bd8df2a05dd67a768 Merged-In: I5f8d5931b404767d3b86cb3bd8df2a05dd67a768 (cherry picked from commit 6563f68968249876cd96b805d37c33d75836e8d8)
2018-10-03MessageLoopThread: Release lock during blocked StartUp/ShutDownHansong Zhang
During StartUp/ShutDown(), if another running task in message loop needs api_lock, then it will deadlock. Release api_lock in StartUp and ShutDown when current thread is blocked by another task Bug: 116081383 Test: run unit test Change-Id: Ic34406d0cfc6364ac965c4f1aa917a5ccaf6b373
2018-09-13Add Timer as an alternative to osi alarmHansong Zhang
* Add a private method MessageLoopThread.DoInThreadDelayed to post a delayed task in message loop, as an alternative approach to osi alarm clock * Add a unit test for MessageLoopThread to check ShutDown() waits until current task finishes * Add Timer using MessageLoopThread.DoInThreadDelayed * Timer provides similar API as osi alarm, and uses same OS clock (boot timer) as alarm * Add benchmark and unit tests to ensure the performance is comparable to the existing osi alarm Test: Run unit test and benchmark test ./test/run_unit_tests.sh bluetooth_test_common ./test/run_benchmarks.sh bluetooth_benchmark_timer_performance --benchmark_repetitions=10 --benchmark_report_aggregates_only=true Bug: 110303473 Change-Id: I6f2e7ae2f80f9889fc5fe3c8cd6b9b2670938b46
2018-08-27Common: Replace ExecutionBarrier with std::promise and std::futureJack He
* std::promise and std::future are able to achieve the same functionalities of ExecutionBarrier with extra flexibility * Replace "_barrier" with "_promise" in system/bt/common Bug: 110303473 Fixes: 112159657 Test: mm -j40, unit test Change-Id: I2a420bbf16bf92e4b3dd256d9f23480fc2be7be1
2018-08-02Add MessageLoopThread, ExecutionBarrier, and performance testsJack He
* Add MessageLoopThread to abstract thread implementation to our code * Add ExecutionBarrier utility class to help with thread synchronization * Add more performance tests and performance benchmarks to evaluate execution efficiency in both batch and sequential usages, for various thread implementations including: - libosi reactor on pthread - MessageLoop on libosi reactor on pthread - MessageLoop on STL std::thread - MessageLoop on Posix pthread - MessageLoop on libchrome base::Thread - MessageLoop on MessageLoopThread Bug: 110303473 Test: make, native and Java unit tests, test/run_benchmarks.sh net_benchmark_thread_performance, test/run_unit_tests.sh net_test_performance, test/run_unit_tests.sh bluetooth_test_common, testplans/details/184455/3975 Change-Id: I5b4ce2ee910a0f1d2edf95e0296916dea04d3f89