Fix BM_ShellShutdown regression (flutter/engine#18676)
This commit is contained in:
@@ -66,6 +66,17 @@ static void StartupAndShutdownShell(benchmark::State& state,
|
||||
|
||||
FML_CHECK(shell);
|
||||
|
||||
{
|
||||
// The ui thread could be busy processing tasks after shell created, e.g.,
|
||||
// default font manager setup. The measurement of shell shutdown should be
|
||||
// considered after those ui tasks have been done.
|
||||
benchmarking::ScopedPauseTiming pause(state, true);
|
||||
fml::AutoResetWaitableEvent latch;
|
||||
fml::TaskRunner::RunNowOrPostTask(thread_host->ui_thread->GetTaskRunner(),
|
||||
[&latch]() { latch.Signal(); });
|
||||
latch.Wait();
|
||||
}
|
||||
|
||||
{
|
||||
benchmarking::ScopedPauseTiming pause(state, !measure_shutdown);
|
||||
// Shutdown must occur synchronously on the platform thread.
|
||||
|
||||
Reference in New Issue
Block a user