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

Commit 2c072724 authored by Sungtak Lee's avatar Sungtak Lee
Browse files

C2BqPool: move pool data destruction out of lock

Move temporary pool data destructions while migrating buffers to new
IGBP out of lock. Dtor may trigger cancel, which requires lock.

Bug: 143147473
Test: atest CtsMediaTestCases -- --module-arg CtsMediaTestCases:size:small
Test: atest android.media.cts.AdaptivePlaybackTest
Change-Id: I215ac6b9fd00db27e2879761160004da432486ab
parent ae3024f8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -576,10 +576,11 @@ public:
            }
        }
        int migrated = 0;
        // poolDatas dtor should not be called during lock is held.
        std::shared_ptr<C2BufferQueueBlockPoolData>
                poolDatas[NUM_BUFFER_SLOTS];
        {
            sp<GraphicBuffer> buffers[NUM_BUFFER_SLOTS];
            std::weak_ptr<C2BufferQueueBlockPoolData>
                    poolDatas[NUM_BUFFER_SLOTS];
            std::scoped_lock<std::mutex> lock(mMutex);
            bool noInit = false;
            for (int i = 0; i < NUM_BUFFER_SLOTS; ++i) {