diff options
author | Daniel Kurtz <djkurtz@chromium.org> | 2017-05-12 19:20:06 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-05-20 20:47:11 -0700 |
commit | de558ae8a22cbd6c0b25691b56c6fd4884ec3ac5 (patch) | |
tree | 1c1ee4bc2eceea4e6ad622a150d7652c806a126b | |
parent | cb1471bc69300f5203aa79b179a861c56c5c569f (diff) |
minigbm: cros_gralloc: Do not lock gralloc_close
cros_gralloc implements Gralloc Module API 0.2. Android framework's
libui uses a Gralloc1On0Adapter adapter on top of gralloc modules < 1.0.
The Gralloc1On0Adapter is a singleton object that calls gralloc_close in
its destructor. cros_gralloc implements gralloc_close() as
cros_gralloc_close().
In other words cros_gralloc_close() is called at process exit during
__cxa_finalize, which is not a safe place to do std::mutex operations.
In fact, the lock_guard() sometimes hangs while trying to aquire the
lock resulting in a non-responsive app.
Fix this by removing the lock_guard in cros_gralloc_close().
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=b/38016927
TEST=Use cherry to run 1 dEQP test.
=> No anr crash after 30 seconds in com.drawelements.deqp:testercore
Change-Id: I469516b8b3a7d8ac6b89e571f137935f097c9af9
Reviewed-on: https://chromium-review.googlesource.com/504429
Commit-Ready: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
-rw-r--r-- | cros_gralloc/cros_alloc_device.cc | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/cros_gralloc/cros_alloc_device.cc b/cros_gralloc/cros_alloc_device.cc index 990ccee..2d7178a 100644 --- a/cros_gralloc/cros_alloc_device.cc +++ b/cros_gralloc/cros_alloc_device.cc @@ -149,7 +149,6 @@ static int cros_gralloc_close(struct hw_device_t *dev) { auto mod = (struct cros_gralloc_module *)dev->module; auto alloc = (struct alloc_device_t *)dev; - std::lock_guard<std::mutex> lock(mod->mutex); if (mod->drv) { drv_destroy(mod->drv); |