summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharath Ramachandramurthy <bramacha@codeaurora.org>2014-10-21 11:18:49 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2014-10-27 17:51:01 -0700
commitfb2c10becf18969eb182048ecf9f1682befebec0 (patch)
treeaabb7ede596664b9b916243a9916d19c7facaaf2
parent49a5ae7540111e90d8e8fcbf650a2e242e3de0f9 (diff)
downloadandroid_hardware_qcom_audio-fb2c10becf18969eb182048ecf9f1682befebec0.tar.gz
android_hardware_qcom_audio-fb2c10becf18969eb182048ecf9f1682befebec0.tar.bz2
android_hardware_qcom_audio-fb2c10becf18969eb182048ecf9f1682befebec0.zip
hal: fix race condition between sthal and ahal
When SSR happens the callbacks between sthal and ahal are called within each context aquiring the locks resulting in race condition. Fixed by removing lock before calling the sthal callback. Change-Id: I6cd88d25758f9c0a6ca39141df6629e2f8b6c0c5
-rw-r--r--hal/audio_extn/soundtrigger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hal/audio_extn/soundtrigger.c b/hal/audio_extn/soundtrigger.c
index c6d7077e..e31678b7 100644
--- a/hal/audio_extn/soundtrigger.c
+++ b/hal/audio_extn/soundtrigger.c
@@ -139,12 +139,12 @@ void audio_extn_sound_trigger_stop_lab(struct stream_in *in)
pthread_mutex_lock(&st_dev->lock);
st_ses_info = get_sound_trigger_info(in->capture_handle);
+ pthread_mutex_unlock(&st_dev->lock);
if (st_ses_info) {
event.u.ses_info = st_ses_info->st_ses;
ALOGV("%s: AUDIO_EVENT_STOP_LAB pcm %p", __func__, st_ses_info->st_ses.pcm);
st_dev->st_callback(AUDIO_EVENT_STOP_LAB, &event);
}
- pthread_mutex_unlock(&st_dev->lock);
}
void audio_extn_sound_trigger_check_and_get_session(struct stream_in *in)
{