Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 68a22d8d authored by beiyifb's avatar beiyifb
Browse files

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
parent f6f72da2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment