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

Commit 86730cff authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera: Sync request thread exit with request clear flag" into main

parents c6533cda 20d5b7fa
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -295,13 +295,6 @@ status_t Camera3Device::disconnectImpl() {
                    }
                }
            }
            // Signal to request thread that we're not expecting any
            // more requests. This will be true since once we're in
            // disconnect and we've cleared off the request queue, the
            // request thread can't receive any new requests through
            // binder calls - since disconnect holds
            // mBinderSerialization lock.
            mRequestThread->setRequestClearing();
        }

        if (mStatus == STATUS_ERROR) {
@@ -3302,8 +3295,12 @@ status_t Camera3Device::RequestThread::waitUntilRequestProcessed(
}

void Camera3Device::RequestThread::requestExit() {
    {
        Mutex::Autolock l(mRequestLock);
        mRequestClearing = true;
        // Call parent to set up shutdown
        Thread::requestExit();
    }
    // The exit from any possible waits
    mDoPauseSignal.signal();
    mRequestSignal.signal();
@@ -4435,11 +4432,6 @@ void Camera3Device::RequestThread::waitForNextRequestBatch() {
    return;
}

void Camera3Device::RequestThread::setRequestClearing() {
    Mutex::Autolock l(mRequestLock);
    mRequestClearing = true;
}

sp<Camera3Device::CaptureRequest>
        Camera3Device::RequestThread::waitForNextRequestLocked() {
    status_t res;
+0 −3
Original line number Diff line number Diff line
@@ -932,9 +932,6 @@ class Camera3Device :
         */
        void     setPaused(bool paused);

        // set mRequestClearing - no new requests are expected to be queued to RequestThread
        void setRequestClearing();

        /**
         * Wait until thread processes the capture request with settings'
         * android.request.id == requestId.