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

Commit a2a19382 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera: Use separate lock for status tracker access sync"

parents 759427db 26d975de
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -277,6 +277,7 @@ status_t Camera3Device::initializeCommonLocked() {
status_t Camera3Device::disconnect() {
    ATRACE_CALL();
    Mutex::Autolock il(mInterfaceLock);
    Mutex::Autolock stLock(mTrackerLock);

    ALOGI("%s: E", __FUNCTION__);

@@ -2728,8 +2729,9 @@ 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);
        // Hold a separate dedicated tracker lock to prevent race with disconnect and also
        // avoid a deadlock during reprocess requests.
        Mutex::Autolock l(mTrackerLock);
        if (mStatusTracker != nullptr) {
            mStatusTracker->markComponentActive(mInFlightStatusId);
        }
@@ -2762,8 +2764,9 @@ 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);
        // Hold a separate dedicated tracker lock to prevent race with disconnect and also
        // avoid a deadlock during reprocess requests.
        Mutex::Autolock l(mTrackerLock);
        if (mStatusTracker != nullptr) {
            mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE);
        }
+3 −0
Original line number Diff line number Diff line
@@ -1210,6 +1210,9 @@ class Camera3Device :

    static callbacks_notify_t sNotify;

    // Synchronizes access to status tracker between inflight updates and disconnect.
    // b/79972865
    Mutex mTrackerLock;
}; // class Camera3Device

}; // namespace android