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

Commit fd0cbfdf authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Camera: Avoid possible race conditions during in-flight dump" into sc-dev am: af78a706

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/15098330

Change-Id: If135d89e1a5efa0b7d2919bdcaf37f6fd87724f6
parents 5d7c8476 af78a706
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -779,6 +779,7 @@ status_t Camera3Device::dump(int fd, const Vector<String16> &args) {
    }

    lines = String8("    In-flight requests:\n");
    if (mInFlightLock.try_lock()) {
        if (mInFlightMap.size() == 0) {
            lines.append("      None\n");
        } else {
@@ -790,6 +791,10 @@ status_t Camera3Device::dump(int fd, const Vector<String16> &args) {
                        r.numBuffersLeft);
            }
        }
        mInFlightLock.unlock();
    } else {
        lines.append("      Failed to acquire In-flight lock!\n");
    }
    write(fd, lines.string(), lines.size());

    if (mRequestThread != NULL) {