Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39cf2ddd authored by Aniket Kumar Lata's avatar Aniket Kumar Lata Committed by android-build-merger
Browse files

Visualizer: Fix deadlock on close

am: e8e1c696

Change-Id: If122dd27a235651275b0cdce61e4486bddf828d8
parents d5d338d8 e8e1c696
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -77,10 +77,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();