Fix Race in TaskSchedulerSingleThreadTaskRunnerManagerStartTest.PostTaskBeforeStart
This race should have been more common but it only reproed on iPhone 7 hardware running iOS 11 with a release version of base_unittests. Setting DCHECK_ALWAYS_ON to true would cause the bug to stop reproing. Because the test task signalled its WaitableEvent at the beginning of the task instead of at the end, it was possible for the function holding |manager_started| to return before the task had a chance to check it. The fix here moves the signalling to the end of the task, ensuring that |manager_started| is alive when it is checked by the test task. BUG=784051 Change-Id: I1e88395bcc45b5390af0c75be806a0a7301e483e Reviewed-on: https://chromium-review.googlesource.com/773299 Commit-Queue: Robert Liao <robliao@chromium.org> Reviewed-by:François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#517139}
Showing
Please register or sign in to comment