PatchPanel: fix deadlock when creating a patch
In PatchPanel::createAudioPatch(), unlock AudioFlinger::mLock when calling
ThreadBase::sendCreateAudioPatchConfigEvent() to avoid deadlocks if the thread loop
needs to acquire AudioFlinger::mLock before processing the create patch request.
Also fix build with verbose log enabled in Threads.cpp.
Bug: 276386807
Test: repro setps in the bug
Change-Id: Iaa4a89588e75113316241373d3bdb6858c3893ba
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index 077fa26..323ce0e 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -425,6 +425,8 @@
bool btNrecIsOff() const { return mBtNrecIsOff.load(); }
+ void lock() ACQUIRE(mLock) { mLock.lock(); }
+ void unlock() RELEASE(mLock) { mLock.unlock(); }
private: