Optimizing OneShotTimer::reset() function
When running simpleperf, reset() function caused every once
in a while locks, which we suspect cause occasional janking.
- Moving the state to atomic, so there is no time spent
acquiring the lock.
- When using condition_variable, atomic still needs to be
changed under mutex, so moving to semaphores to guard
and signal.
See b/170665374 for analysis report.
Bug: 170665374
Test: atest DisplayMicrobenchTests while running simple perf
Test: atest OneShotTimerTest
Change-Id: Ic450ea074bc07175c3fc681b69a8009be84d30a0
2 files changed