platform_hardware_interfaces/audio/aidl/common
Mikhail Naganov 0b9c5feed1 audio: Fix the lifetime of the StreamWorker's logic part
Fix the mistake of making StreamWorker to inherit
from the part which provides actual thread logic (Impl).
The lifetime of the logic object must be longer
than the lifetime of the StreamWorker's thread.
Otherwise, the thread could still have running while
the logic has already been destroyed (consider
the order of destructors in C++ class inheritance).

With this fix, the StreamWorker class does not have
to be a template anymore, thus reorganize the code
to move big methods into a .cpp file.

Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I5bc2c8fd9d78a0fbc9fddab67456cc5214584045
Change-Id: I5bc2c8fd9d78a0fbc9fddab67456cc5214584045
(cherry picked from commmit 84024eccee)

Change-Id: I70958f437657b574cda6480c3216a0b1ea252433
2022-08-30 01:36:31 +00:00
..
include audio: Fix the lifetime of the StreamWorker's logic part 2022-08-30 01:36:31 +00:00
tests audio: Fix the lifetime of the StreamWorker's logic part 2022-08-30 01:36:31 +00:00
Android.bp audio: Fix the lifetime of the StreamWorker's logic part 2022-08-30 01:36:31 +00:00
StreamWorker.cpp audio: Fix the lifetime of the StreamWorker's logic part 2022-08-30 01:36:31 +00:00
TEST_MAPPING audio: Add StreamWorker to aidl/common 2022-08-26 02:41:58 +00:00