SF: Fix thread safety for scheduler callbacks
SurfaceFlinger::setRefreshRateTo, called from the Scheduler callbacks, reads HWC and SF state without locking mStateLock, concurrently with writes from the main thread. This CL registers ResetIdleTimerCallback per EventThreadConnection, and locks mStateLock for connections used off the main thread. Note that ExpiredTimerCallback locks mStateLock unconditionally, since it is always called from the IdleTimer thread. This CL also adds a thread annotation to setRefreshRateTo, and refactors it accordingly. Bug: 123715322 Test: libsurfaceflinger_unittest Test: Boot with scheduler enabled Change-Id: Id62c48ae22da38f292ffc18e8731a1c49a0a083c
Loading
Please register or sign in to comment