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

Commit f5b5614a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "stagefright: ExtendedStats: Add lock in TimeBoundVector"

parents 0dbc537f 6360911c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ public:
        private:
            SortedVector<StatsFrameInfoWrapper> mList;
            StatsFrameInfoPool& mFrameInfoPool;
            Mutex mLock;
    };

    struct AutoProfile {
+2 −0
Original line number Diff line number Diff line
@@ -287,6 +287,7 @@ ExtendedStats::StatsFrameInfoPool::~StatsFrameInfoPool() {

/* TimeBoundVector methods */
void ExtendedStats::TimeBoundVector::add(StatsFrameInfoWrapper item) {
    Mutex::Autolock lock(mLock);
    mList.add(item);
    mCurrBoundedSum += (item.infoPtr)->size;
    mTotalSizeSum += (item.infoPtr)->size;
@@ -316,6 +317,7 @@ void ExtendedStats::TimeBoundVector::add(StatsFrameInfoWrapper item) {
}

void ExtendedStats::TimeBoundVector::clear() {
    Mutex::Autolock lock(mLock);
    for (uint32_t i = 0; i < mList.size(); i++) {
        delete mList.editItemAt(i).infoPtr;
        mList.editItemAt(i).infoPtr = 0;