diff options
author | Grigori Goronzy <greg@chown.ath.cx> | 2013-03-02 17:49:51 +0100 |
---|---|---|
committer | Konsta <konsta09@gmail.com> | 2013-03-05 20:33:45 +0200 |
commit | ad72add2d714bcd4107b4e51f0feb0386db6858a (patch) | |
tree | 6bbd3629f7e1048b0fd43fbdcf14204f1af9bc1d /fmradio | |
parent | 2fc3d545c815a47517bfdcbf3d634ae3f06025b0 (diff) | |
download | frameworks_base-ad72add2d714bcd4107b4e51f0feb0386db6858a.zip frameworks_base-ad72add2d714bcd4107b4e51f0feb0386db6858a.tar.gz frameworks_base-ad72add2d714bcd4107b4e51f0feb0386db6858a.tar.bz2 |
FM Radio: avoid deadlock when disabling RDS
When RDS is being configured, the session mutex is hold. However,
when it is being disabled, RDS callbacks might still fire, and these
also try to hold the mutex, leading to a deadlock.
Temporary unlock the mutex while the vendor library is called to
work around.
Change-Id: Ic9751c7185fd8de4a7510225f54d23a22f042321
Diffstat (limited to 'fmradio')
-rwxr-xr-x | fmradio/jni/android_fmradio_Receiver.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fmradio/jni/android_fmradio_Receiver.cpp b/fmradio/jni/android_fmradio_Receiver.cpp index 78e3e16..10a0466 100755 --- a/fmradio/jni/android_fmradio_Receiver.cpp +++ b/fmradio/jni/android_fmradio_Receiver.cpp @@ -1362,8 +1362,11 @@ static void androidFmRadioRxSetRDS(JNIEnv * env, jobject obj, /* if in pause state temporary resume */ androidFmRadioTempResumeIfPaused(&fmReceiverSession); + /* temporary unlock to avoid deadlock with RDS callback */ + pthread_mutex_unlock(fmReceiverSession.dataMutex_p); retval = fmReceiverSession.vendorMethods_p-> set_rds_reception(&fmReceiverSession.vendorData_p, receiveRDS); + pthread_mutex_lock(fmReceiverSession.dataMutex_p); androidFmRadioPauseIfTempResumed(&fmReceiverSession); } else { |