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

Commit 980796c3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Camera: fix status tracker race condition"

parents 67106b6d 12794d4f
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2326,8 +2326,12 @@ status_t Camera3Device::registerInFlight(uint32_t frameNumber,
    if (res < 0) return res;

    if (mInFlightMap.size() == 1) {
        // hold mLock to prevent race with disconnect
        Mutex::Autolock l(mLock);
        if (mStatusTracker != nullptr) {
            mStatusTracker->markComponentActive(mInFlightStatusId);
        }
    }

    return OK;
}
@@ -2353,9 +2357,13 @@ void Camera3Device::removeInFlightMapEntryLocked(int idx) {

    // Indicate idle inFlightMap to the status tracker
    if (mInFlightMap.size() == 0) {
        // hold mLock to prevent race with disconnect
        Mutex::Autolock l(mLock);
        if (mStatusTracker != nullptr) {
            mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE);
        }
    }
}

void Camera3Device::removeInFlightRequestIfReadyLocked(int idx) {