summaryrefslogtreecommitdiff
path: root/opengl/libagl/array.cpp
diff options
context:
space:
mode:
author Arthur Ishiguro <arthuri@google.com> 2020-04-06 08:50:20 -0700
committer Arthur Ishiguro <arthuri@google.com> 2020-04-06 16:58:25 -0700
commit410d567e0df67dc386b34267b077f84051e6b5fa (patch)
tree4d3b089e0b2ed8035ae5b213394703f7ec3a28c4 /opengl/libagl/array.cpp
parent584ab0d9d98d0f0ae0b5974353e8369f46fff889 (diff)
Fix deadlock on SensorService
If mLock is held by SensorService::threadLoop(), and a new call from SensorEventConnection comes in to e.g. enable/disable a sensor, this thread must wait for the mLock to be released. However, if this thread holds mConnectionLock in SensorEventConnection, and SensorService invokes SensorEventConnection.sendEvent, the system will come into a deadlock because both threads are waiting for each other. To avoid this situation unlock SensotEventConnection's mConnectionLock while going out of scope. Also create separate mutexes for modifying mSensorInfo and mSensorInfoBackup for better separation. Bug: 153188258 Test: 1) Run sensor logger and enable sensor, put app in background. 2) Open a_sns_test and start streaming sensor samples 3) Open app again and verify no system ANR, sensor samples continue to be received on app. Change-Id: If137f39918a8b1148dcc00f1b1d82b4454bb5c7b
Diffstat (limited to 'opengl/libagl/array.cpp')
0 files changed, 0 insertions, 0 deletions