From f777331418a86cd9fd709af898ef24a69967aeb4 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 13 Aug 2013 16:00:42 -0700 Subject: [PATCH] Add ThreadBase::processConfigEvents_l() Change-Id: I6bcdc212a984c52ab98b0b0744943b4ecc1e1542 --- services/audioflinger/Threads.cpp | 8 ++++++-- services/audioflinger/Threads.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 49520a1e5b..9540e0ac3a 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -376,7 +376,12 @@ void AudioFlinger::ThreadBase::sendPrioConfigEvent_l(pid_t pid, pid_t tid, int32 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 @@ void AudioFlinger::ThreadBase::processConfigEvents() delete event; mLock.lock(); } - mLock.unlock(); } void AudioFlinger::ThreadBase::dumpBase(int fd, const Vector& args) diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h index 47dd3bd417..176314aafb 100644 --- a/services/audioflinger/Threads.h +++ b/services/audioflinger/Threads.h @@ -143,6 +143,7 @@ public: 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; } -- 2.11.0