aaudio: cleanup thread handling
Fix problem when an attempt is made to join the callback from the
callback. It used to leave mHasThread in the wrong state.
This was fixed in AAudioThread and in AudioStream.
Add "_l" suffix to functions that need to be locked.
Simplify the way that reference counted objects are passed to threads
using incStrong() and decStrong().
Bug: 171296283
Test: atest AAudioTestCases
Change-Id: I034049c4cb9021c6073fff441e49214ee898b804
diff --git a/media/libaaudio/src/client/AudioStreamInternalPlay.h b/media/libaaudio/src/client/AudioStreamInternalPlay.h
index 7b1cddc..03c957d 100644
--- a/media/libaaudio/src/client/AudioStreamInternalPlay.h
+++ b/media/libaaudio/src/client/AudioStreamInternalPlay.h
@@ -35,9 +35,9 @@
aaudio_result_t open(const AudioStreamBuilder &builder) override;
- aaudio_result_t requestPause() override;
+ aaudio_result_t requestPause_l() override;
- aaudio_result_t requestFlush() override;
+ aaudio_result_t requestFlush_l() override;
bool isFlushSupported() const override {
// Only implement FLUSH for OUTPUT streams.