summaryrefslogtreecommitdiff
path: root/opengl/libagl/TextureObjectManager.cpp
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2018-02-20 12:34:15 -0800
committer Robert Carr <racarr@google.com> 2018-02-20 13:22:20 -0800
commit5e8e1f00889b0e7a56bffac5e999591a73ba92de (patch)
treee99f031405c8ec6d005d32fde12bf25a2a54daa4 /opengl/libagl/TextureObjectManager.cpp
parenteb7d56760522c0033a460eba99909953d73fe606 (diff)
SurfaceFlinger: Prevent deadlock when destroying Client.
It's possible that we may destroy the Client while holding the SurfaceFlinger lock even though the layers only hold a weak reference. For example imagine a sp<Layer> with last reference in SurfaceFlinger#mDrawingState. When we swap mCurrentState to mDrawingState while holding the lock, we could thus trigger Layer::~Layer. This promotes an sp to the Client (mClientRef) and removes the layer from it. At this point another thread could drop the only other remaining reference to the client. This means when we leave ~Layer, ~Client will be invoked. ~Client tries to again acquire the SurfaceFlinger lock leading to deadlock. It seems painful to insist that sp<Client> can't be descoped while holding the SF locked so I opted for pushing the messages from ~Client to a handler. Bug: 72838192 Test: Boots Change-Id: I3fa2147f418caa0df1d86b3227eec8c56a0e5f7d
Diffstat (limited to 'opengl/libagl/TextureObjectManager.cpp')
0 files changed, 0 insertions, 0 deletions