Visualizer: Fix deadlock on close
Visualizer gets stuck in mCaptureThread::requestExitAndWait due to a deadlock between mCaptureThread::mRunning and mCaptureLock. Temporarily release mCaptureLock upon mCaptureThread::requestExitAndWait. Test: Clarity -> Response, rapidly toggle visualizer enable, disable Bug: 135326776 authored-by: Weiyin Jiang <wjiang@codeaurora.org> Change-Id: If32431c4d7b271b7ea61168cb1a5a42f3a1cd66e
This commit is contained in:
committed by
Marco Nelissen
parent
70694b005d
commit
b2f11e6cc4
@@ -78,10 +78,13 @@ status_t Visualizer::setEnabled(bool enabled)
|
||||
if (t != 0) {
|
||||
if (enabled) {
|
||||
if (t->exitPending()) {
|
||||
mCaptureLock.unlock();
|
||||
if (t->requestExitAndWait() == WOULD_BLOCK) {
|
||||
mCaptureLock.lock();
|
||||
ALOGE("Visualizer::enable() called from thread");
|
||||
return INVALID_OPERATION;
|
||||
}
|
||||
mCaptureLock.lock();
|
||||
}
|
||||
}
|
||||
t->mLock.lock();
|
||||
|
||||
Reference in New Issue
Block a user