Fixes a thread safety issue (a time-of-check-time-of-use bug) in...
Fixes a thread safety issue (a time-of-check-time-of-use bug) in BatteryExternalStatsWorker that causes system_server crashes in VROS device. Synchronize BatteryExternalStatsWorker.shutdown(). Without this, a shutdown can sneak in-between the checks to mExecutor.isShutdown() and other mExecutor calls, causing the later calls to fail with a RejectedExecutionException instead of having the intended behavior for a shutdown mExecutor. Test: There is no known test case for regression testing. This is a race condition, so any test case would inherently be flaky. The correctness of the patch is easily seen by observing the time-of-check-time-of-use issues that arise throughout BatteryExternalStatsWorker.java before the patch is applied. Change-Id: Id690f3451f86ac536b186021ef4fb63827bc863e
Loading
Please register or sign in to comment