summaryrefslogtreecommitdiffstats
path: root/fmradio
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@chown.ath.cx>2013-03-02 17:49:51 +0100
committerKonsta <konsta09@gmail.com>2013-03-05 20:33:45 +0200
commitad72add2d714bcd4107b4e51f0feb0386db6858a (patch)
tree6bbd3629f7e1048b0fd43fbdcf14204f1af9bc1d /fmradio
parent2fc3d545c815a47517bfdcbf3d634ae3f06025b0 (diff)
downloadframeworks_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-xfmradio/jni/android_fmradio_Receiver.cpp3
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 {