Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 42b40b4

Browse files
authored
Fix BM_ShellShutdown regression (#18676)
1 parent c9e51d0 commit 42b40b4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

shell/common/shell_benchmarks.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ static void StartupAndShutdownShell(benchmark::State& state,
6666

6767
FML_CHECK(shell);
6868

69+
{
70+
// The ui thread could be busy processing tasks after shell created, e.g.,
71+
// default font manager setup. The measurement of shell shutdown should be
72+
// considered after those ui tasks have been done.
73+
benchmarking::ScopedPauseTiming pause(state, true);
74+
fml::AutoResetWaitableEvent latch;
75+
fml::TaskRunner::RunNowOrPostTask(thread_host->ui_thread->GetTaskRunner(),
76+
[&latch]() { latch.Signal(); });
77+
latch.Wait();
78+
}
79+
6980
{
7081
benchmarking::ScopedPauseTiming pause(state, !measure_shutdown);
7182
// Shutdown must occur synchronously on the platform thread.

0 commit comments

Comments
 (0)