Merge "fix a possible deadlock when removing a layer and destroying a client"

This commit is contained in:
Jean-Baptiste Queru 2013-08-06 18:37:12 +00:00 committed by Gerrit Code Review
commit 046b72fc5d

View File

@ -1037,6 +1037,12 @@ void SurfaceFlinger::handleTransaction(uint32_t transactionFlags)
{
ATRACE_CALL();
// here we keep a copy of the drawing state (that is the state that's
// going to be overwritten by handleTransactionLocked()) outside of
// mStateLock so that the side-effects of the State assignment
// don't happen with mStateLock held (which can cause deadlocks).
State drawingState(mDrawingState);
Mutex::Autolock _l(mStateLock);
const nsecs_t now = systemTime();
mDebugInTransaction = now;