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

Commit 43bfe7f0 authored by Jesse Hall's avatar Jesse Hall Committed by Android Git Automerger
Browse files

am a91e54fe: am f57c1388: Merge "SurfaceFlinger: fix layer removal race condition" into ics-mr1

* commit 'a91e54fed6a0690d59c97bab9b081b2614880563':
  SurfaceFlinger: fix layer removal race condition
parents af2eab22 19a586f7
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -720,6 +720,14 @@ void SurfaceFlinger::computeVisibleRegions(

void SurfaceFlinger::commitTransaction()
{
    if (!mLayersPendingRemoval.isEmpty()) {
        // Notify removed layers now that they can't be drawn from
        for (size_t i = 0; i < mLayersPendingRemoval.size(); i++) {
            mLayersPendingRemoval[i]->onRemoved();
        }
        mLayersPendingRemoval.clear();
    }

    mDrawingState = mCurrentState;
    mTransationPending = false;
    mTransactionCV.broadcast();
@@ -1172,7 +1180,7 @@ status_t SurfaceFlinger::purgatorizeLayer_l(const sp<LayerBase>& layerBase)
        mLayerPurgatory.add(layerBase);
    }

    layerBase->onRemoved();
    mLayersPendingRemoval.push(layerBase);

    // it's possible that we don't find a layer, because it might
    // have been destroyed already -- this is not technically an error
+1 −0
Original line number Diff line number Diff line
@@ -352,6 +352,7 @@ private:
                Condition               mTransactionCV;
                SortedVector< sp<LayerBase> > mLayerPurgatory;
                bool                    mTransationPending;
                Vector< sp<LayerBase> > mLayersPendingRemoval;

                // protected by mStateLock (but we could use another lock)
                GraphicPlane                mGraphicPlanes[1];