OSDN Git Service

fix a bug where surfaceflinger and system_server could deadlock
authorMathias Agopian <mathias@google.com>
Tue, 9 Jul 2013 00:09:41 +0000 (17:09 -0700)
committerMathias Agopian <mathias@google.com>
Tue, 9 Jul 2013 01:52:05 +0000 (18:52 -0700)
commit2ed0fe59b482f8d6b35a50ebc8e9e060813f4568
treeaf0659a7f432b287281f801f993cadd9386a3b2a
parent547e98f33c829eb2e3948a57e491a9106afa1f5e
fix a bug where surfaceflinger and system_server could deadlock

    because surfaceflinger handles screenshot in a different
    thread from the binder thread that requested it and because
    the IGraphicBufferProducer is a synchronous interface
    calling back into the system server; it is possible for
    the latter to run out of binder threads (b/c it holds
    a lock while calling into SF).

    The solution is to make sure all calls on IGraphicBufferProducer
    happen on the incoming binder thread. We achieve this by creating
    a IGBP wrapper which is given to the screenshot code.

    Bug: 8734824

Change-Id: I2be85660d9dc65d239d68f6d3ab3c973c13b34cc
services/surfaceflinger/SurfaceFlinger.cpp