AudioFlinger: Use audio_utils::mutex
Test: atest AudioTrackTest AudioRecordTest
Test: atest AAudioTests AudioTrackOffloadTest
Test: atest AudioPlaybackCaptureTest
Test: Camera YouTube
Bug: 298534151
Change-Id: Iba9e1e8f6d5f9ad2e31ea4e09598f2829ece3f02
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index e93046e..d48bcef 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -277,7 +277,7 @@
mCblkMemory.clear(); // free the shared memory before releasing the heap it belongs to
if (mClient != 0) {
// Client destructor must run with AudioFlinger client mutex locked
- Mutex::Autolock _l(mClient->afClientCallback()->clientMutex());
+ audio_utils::lock_guard _l(mClient->afClientCallback()->clientMutex());
// If the client's reference count drops to zero, the associated destructor
// must run with AudioFlinger lock held. Thus the explicit clear() rather than
// relying on the automatic clear() at end of scope.
@@ -1167,7 +1167,7 @@
const sp<IAfThreadBase> thread = mThread.promote();
if (thread != 0) {
if (isOffloaded()) {
- Mutex::Autolock _laf(thread->afThreadCallback()->mutex());
+ audio_utils::lock_guard _laf(thread->afThreadCallback()->mutex());
Mutex::Autolock _lth(thread->mutex());
sp<IAfEffectChain> ec = thread->getEffectChain_l(mSessionId);
if (thread->afThreadCallback()->isNonOffloadableGlobalEffectEnabled_l() ||