summaryrefslogtreecommitdiff
path: root/opengl/libagl/matrix.cpp
diff options
context:
space:
mode:
author Brian Duddie <bduddie@google.com> 2019-06-10 11:08:27 -0700
committer Anthony Stange <stange@google.com> 2019-08-07 19:20:35 +0000
commit967ce17e9d6344914ea92d9148d2fd37579e818b (patch)
tree610b4e082d275406817fcf37f113d75af8d8cb5d /opengl/libagl/matrix.cpp
parent6db8d55765ab44b3f0c2bd01417d4682a0e6e474 (diff)
Avoid potential deadlocks in SensorService
Sensor connections are held as weak pointers in SensorService, but promoted to strong pointer with a lock held when the service needs to operate on them. They are typically destroyed by Binder when the remote end goes away, dropping the final reference count to 0. However, if a remote dies while the service is holding an sp on the connection, the destructor will be invoked when the local object goes out of scope. If this happens with the lock held, the system will deadlock as the destructor attempts to acquire the same lock. Fix all occurrences of this in SensorService by creating two wrapper classes: one that exposes only write access to the connection lists, and one that returns a copy of a connection list, with elements promoted to sp, and holds onto the sp references until the lock is released. Bug: 137369322 Test: run sensors CTS Change-Id: I68136819cc63ab54071f523d3e8b1318adf03e7e
Diffstat (limited to 'opengl/libagl/matrix.cpp')
0 files changed, 0 insertions, 0 deletions