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

Commit 5529c13a authored by Andy Hung's avatar Andy Hung
Browse files

audioserver: Add notification tid metadata to the command thread wait

Add tid argument to the condition variable wait for TimeCheck analysis.

Test: compiles
Bug: 322424558
Merged-In: Iff9d561383f595eca236dce2783c1025aa04bb03
Change-Id: Iff9d561383f595eca236dce2783c1025aa04bb03
parent 519c1375
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -721,7 +721,8 @@ NO_THREAD_SAFETY_ANALYSIS // condition variable
    {
        audio_utils::unique_lock _l(event->mutex());
        while (event->mWaitStatus) {
            if (event->mCondition.wait_for(_l, std::chrono::nanoseconds(kConfigEventTimeoutNs))
            if (event->mCondition.wait_for(
                    _l, std::chrono::nanoseconds(kConfigEventTimeoutNs), getTid())
                            == std::cv_status::timeout) {
                event->mStatus = TIMED_OUT;
                event->mWaitStatus = false;
+1 −1
Original line number Diff line number Diff line
@@ -2481,7 +2481,7 @@ status_t AudioPolicyService::AudioCommandThread::sendCommand(sp<AudioCommand>& c
    while (command->mWaitStatus) {
        nsecs_t timeOutNs = kAudioCommandTimeoutNs + milliseconds(delayMs);
        if (command->mCond.wait_for(
                    ul, std::chrono::nanoseconds(timeOutNs)) == std::cv_status::timeout) {
                ul, std::chrono::nanoseconds(timeOutNs), getTid()) == std::cv_status::timeout) {
            command->mStatus = TIMED_OUT;
            command->mWaitStatus = false;
        }