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

Commit a76d4d88 authored by Bart Van Assche's avatar Bart Van Assche
Browse files

audio: Simplify AudioHalBinderServiceUtil::waitForFired()

Return the std::condition::wait_for() return value instead of reading
the variable 'fired' again. See also
https://en.cppreference.com/w/cpp/thread/condition_variable/wait_for

.

Change-Id: I48c270f5446f61b2ad828b19a1fc294737a123dd
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 3143e693
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -71,8 +71,7 @@ class AudioHalBinderServiceUtil {

        bool waitForFired(std::chrono::milliseconds timeoutMs) {
            std::unique_lock<std::mutex> lock(mutex);
            condition.wait_for(lock, timeoutMs, [this]() { return fired; });
            return fired;
            return condition.wait_for(lock, timeoutMs, [this]() { return fired; });
        }

      private: