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

Commit fb33d064 authored by Shunkai Yao's avatar Shunkai Yao Committed by Gerrit Code Review
Browse files

Merge "AudioFlinger: update primaryPlaybackThread_l() getter" into main

parents e4166084 4f32af4c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3812,7 +3812,11 @@ audio_unique_id_t AudioFlinger::nextUniqueId(audio_unique_id_use_t use)

IAfPlaybackThread* AudioFlinger::primaryPlaybackThread_l() const
{
    audio_utils::lock_guard lock(hardwareMutex());
    // The atomic ptr mPrimaryHardwareDev requires both the
    // AudioFlinger and the Hardware mutex for modification.
    // As we hold the AudioFlinger mutex, we access it
    // safely without the Hardware mutex, to avoid mutex order
    // inversion with Thread methods and the ThreadBase mutex.
    if (mPrimaryHardwareDev == nullptr) {
        return nullptr;
    }