OSDN Git Service

[DO NOT MERGE] fix a bug where surfaceflinger and system_server could deadlock
authorMathias Agopian <mathias@google.com>
Thu, 16 May 2013 02:14:52 +0000 (19:14 -0700)
committerMathias Agopian <mathias@google.com>
Fri, 17 May 2013 20:20:53 +0000 (13:20 -0700)
commit23dacde4b624921df4f2c9646d20ca7acae357b6
treeb3a3d107e153848a8639168359932460585e854b
parentea74d3b78d607cde17790a7bb83e6f68ffd34cfd
[DO NOT MERGE] 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: Ife2441c7322e51ecfb20e0df03dacf6bce49578e
services/surfaceflinger/SurfaceFlinger.cpp