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

Commit d50ae62f authored by Phil Burk's avatar Phil Burk
Browse files

aaudio: unlock when joining the timestamp thread

This will prevent a deadlock in case the timestamp
thread tries to acquire the same lock.

Bug: 182852602
Test: plug and unplug headphones while playing
Change-Id: I625d191906c7e280f3a223f476716ef17b9098ea
parent d9996aa2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -336,7 +336,12 @@ aaudio_result_t AAudioServiceStreamBase::stop_l() {

    setState(AAUDIO_STREAM_STATE_STOPPING);

    // Temporarily unlock because we are joining the timestamp thread and it may try
    // to acquire mLock.
    mLock.unlock();
    result = stopTimestampThread();
    mLock.lock();

    if (result != AAUDIO_OK) {
        disconnect_l();
        return result;