Add ThreadBase::processConfigEvents_l()
Change-Id: I6bcdc212a984c52ab98b0b0744943b4ecc1e1542
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 49520a1..9540e0a 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -376,7 +376,12 @@
void AudioFlinger::ThreadBase::processConfigEvents()
{
- mLock.lock();
+ Mutex::Autolock _l(mLock);
+ processConfigEvents_l();
+}
+
+void AudioFlinger::ThreadBase::processConfigEvents_l()
+{
while (!mConfigEvents.isEmpty()) {
ALOGV("processConfigEvents() remaining events %d", mConfigEvents.size());
ConfigEvent *event = mConfigEvents[0];
@@ -408,7 +413,6 @@
delete event;
mLock.lock();
}
- mLock.unlock();
}
void AudioFlinger::ThreadBase::dumpBase(int fd, const Vector<String16>& args)
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 47dd3bd..176314a 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -143,6 +143,7 @@
void sendIoConfigEvent_l(int event, int param = 0);
void sendPrioConfigEvent_l(pid_t pid, pid_t tid, int32_t prio);
void processConfigEvents();
+ void processConfigEvents_l();
// see note at declaration of mStandby, mOutDevice and mInDevice
bool standby() const { return mStandby; }