MelReporter, PatchCommandThread: Update to audio_utils mutex
Test: atest AudioTrackTest AudioRecordTest
Test: atest AAudioTests AudioTrackOffloadTest
Test: atest AudioPlaybackCaptureTest
Test: Camera YouTube
Bug: 298534151
Change-Id: I3dc0999d66cc46db32e251ac879f92e36a93e7fc
diff --git a/services/audioflinger/PatchCommandThread.h b/services/audioflinger/PatchCommandThread.h
index 66018d7..5ee0f4a 100644
--- a/services/audioflinger/PatchCommandThread.h
+++ b/services/audioflinger/PatchCommandThread.h
@@ -121,13 +121,16 @@
void sendCommand(const sp<Command>& command);
- std::string mThreadName;
- std::mutex mLock;
- std::condition_variable mWaitWorkCV;
- std::deque<sp<Command>> mCommands GUARDED_BY(mLock); // list of pending commands
+ audio_utils::mutex& mutex() const { return mMutex; }
+ audio_utils::mutex& listenerMutex() const { return mListenerMutex; }
- std::mutex mListenerLock;
- std::vector<wp<PatchCommandListener>> mListeners GUARDED_BY(mListenerLock);
+ std::string mThreadName;
+ mutable audio_utils::mutex mMutex;
+ audio_utils::condition_variable mWaitWorkCV;
+ std::deque<sp<Command>> mCommands GUARDED_BY(mutex()); // list of pending commands
+
+ mutable audio_utils::mutex mListenerMutex;
+ std::vector<wp<PatchCommandListener>> mListeners GUARDED_BY(listenerMutex());
};
} // namespace android