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

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

Merge "Fix thread safety issue on clearing cache"

parents bf95b70f f9a4bb18
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -315,6 +315,7 @@ void StatsPullerManager::OnAlarmFired(int64_t elapsedTimeNs) {
}

int StatsPullerManager::ForceClearPullerCache() {
    std::lock_guard<std::mutex> _l(mLock);
    int totalCleared = 0;
    for (const auto& pulledAtom : kAllPullAtomInfo) {
        totalCleared += pulledAtom.second->ForceClearCache();
@@ -323,6 +324,7 @@ int StatsPullerManager::ForceClearPullerCache() {
}

int StatsPullerManager::ClearPullerCacheIfNecessary(int64_t timestampNs) {
    std::lock_guard<std::mutex> _l(mLock);
    int totalCleared = 0;
    for (const auto& pulledAtom : kAllPullAtomInfo) {
        totalCleared += pulledAtom.second->ClearCacheIfNecessary(timestampNs);