summaryrefslogtreecommitdiff
path: root/api/api.go
diff options
context:
space:
mode:
author Kevin Chyn <kchyn@google.com> 2023-05-15 23:38:43 +0000
committer Kevin Chyn <kchyn@google.com> 2023-05-17 17:42:42 +0000
commit383b57ab696b5ea66541e6e5374c86f10d2a5faa (patch)
tree1682cbd9b230ca28d88fd98ab470630e54937f74 /api/api.go
parent0f6b4e2348ccba918a52074be7321e08ad9d9cb0 (diff)
Synchronize DeviceStateController on WindowManagerGlobalLock
The existing way of synchronizing on DeviceStateController.this is prone to deadlocks. For example, this sequence of events will result in a deadlock. ThreadA: 1) Acquire WindowManagerGlobalLock 4) Acquire DeviceStateController.this ThreadB) 2) Acquire DeviceStateController.this 3) Acquire WindowManagerGlobalLock Instead of using DeviceStateController.this as a lock, we should just use the existing WindowManagerGlobalLock like the rest of WM code. This way, since all locking is done on the same global lock, there shouldn't be a way for this deadlock to occur anymore. Also, put work onto WindowManagerService's handler so that DeviceStateController's lock when invoking callbacks is short. Fixes: 281653024 Test: presubmit Change-Id: I3c0086856c245a01c951d295a040c93c82c8a485
Diffstat (limited to 'api/api.go')
0 files changed, 0 insertions, 0 deletions