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

Commit 932f63ef authored by Dichen Zhang's avatar Dichen Zhang
Browse files

NuPlayer::GenericSource::onPrepareAsync():Change lock order

mLock and mDisconnect lock order interleaving,
which has potential risk of deadlock if other code locks/unlocks them in a different order.

Bug: 135211710
Test: (1) android.hardware.camera2.cts.FastBasicsTest#testCamera1
      (2) android.media.cts.MediaPlayerFlakyNetworkTest

Change-Id: I9486f2c6780c2f246786299a3d6c7c2f7295b768
parent c5bfbeaf
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -404,8 +404,8 @@ void NuPlayer::GenericSource::onPrepareAsync() {
            sp<DataSource> dataSource = DataSourceFactory::CreateFromURI(
                   mHTTPService, uri, &mUriHeaders, &contentType,
                   static_cast<HTTPBase *>(mHttpSource.get()));
            mLock.lock();
            mDisconnectLock.lock();
            mLock.lock();
            if (!mDisconnected) {
                mDataSource = dataSource;
            }