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

Skip to content
Commit dbb69167 authored by Yu Shan's avatar Yu Shan
Browse files

Fix a race condition in RecurrentTimer.

Previously RecurrentTimer might not exit correctly if the mStopRequested
is set to true after we check for the value in the loop, but before
we start the wait. We will notify before we start waiting, causing the
wait never to return until timeout.

This CL guards updating mStopRequested with lock to make sure that it
must not change between our check and the wait.

After the fix we see no more flaky tests and decreased test execution
time since we will not wait for the next event to come before we end
the timer.

Test: atest android.hardware.automotive.vehicle@2.0-default-impl-unit-tests
Bug: 311757267
Change-Id: Iab1d72b954b4b02aa68e6fbbabcb97b572614d35
parent c3e08a9c
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