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

Commit 7d19d464 authored by Rhed Jao's avatar Rhed Jao Committed by Automerger Merge Worker
Browse files

Faster bugreports (4/n) am: 2cc4eec9 am: 53a0049d am: f92a35a9

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1441345

Change-Id: I5f1a41429501cb3ce31bb79532672991c1e721fc
parents 8223891e f92a35a9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3881,12 +3881,16 @@ void dump_route_tables() {
    fclose(fp);
}

// TODO: make this function thread safe if sections are generated in parallel.
void Dumpstate::UpdateProgress(int32_t delta_sec) {
    if (progress_ == nullptr) {
        MYLOGE("UpdateProgress: progress_ not set\n");
        return;
    }
    // This function updates progress related members of the dumpstate and reports
    // progress percentage to the bugreport client. Since it could be called by
    // different dump tasks at the same time if the parallel run is enabled, a
    // mutex lock is necessary here to synchronize the call.
    std::lock_guard<std::recursive_mutex> lock(mutex_);

    // Always update progess so stats can be tuned...
    progress_->Inc(delta_sec);
+2 −0
Original line number Diff line number Diff line
@@ -572,6 +572,8 @@ class Dumpstate {

    android::sp<ConsentCallback> consent_callback_;

    std::recursive_mutex mutex_;

    DISALLOW_COPY_AND_ASSIGN(Dumpstate);
};