diff options
| author | 2022-06-14 23:25:11 +0000 | |
|---|---|---|
| committer | 2022-06-22 03:01:26 +0000 | |
| commit | a556d071c1731df6103c8eb86a52503b962c33bc (patch) | |
| tree | a81e413dad859f58e5f9da5a4096cc72f02b7352 /libs/gui/ConsumerBase.cpp | |
| parent | 900cec500a77aa8152d5ccb181875e3e31e9ae91 (diff) | |
SF: Fix deadlock while stopping idle timer
scope_lock `mRefreshRateConfigsLock` is acquired
during `Scheduler::setRefreshRateConfigs` to
stop & clear the existing idle timer callback.
And in the meantime, when the code in
`OneShotTimer::loop` encounters the timeout
and then timeoutcallback is requested from
OneShotTimer::loop, this callback in
`Scheduler::kernelIdleTimerCallback`
will try to acquire the lock on
`mRefreshRateConfigsLock`.
The OneShotTimer::stop which is called to reset
the idle timer from the
`Scheduler::setRefreshRateConfigs` now join on
the OneShotTimer::loop thread that is now blocked
waiting on the `mRefreshRateConfigsLock`. So this
call never finishes and deadlock happens.
When we use the fakeGuard to lock `mRefreshRateConfigsLock`
we fake the lock and stop the idle timer. This is okay to do
as we only update mRefreshRateConfig on the main thread.
Test: atest libsurfaceflinger_unittest
go/wm-smoke
BUG: 233423207
Change-Id: I146325193b57d81bc3423426355791ca0ec962f5
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
0 files changed, 0 insertions, 0 deletions