提交 9cfc67ef 编写于 作者: A Adam Barth 提交者: GitHub

Retrieve the last error from the proper thread (#3649)

Previously, the last error was a global static. Now it is a thread-specific
value, which means we need to visit the UI thread to read the value.
上级 0efcb4a6
......@@ -102,8 +102,14 @@ void RunNonInteractive(ftl::CommandLine initial_command_line,
test_runner.platform_view().engine().GetLoadScriptError();
if (error == tonic::kNoError)
error = task_observer.last_error();
if (error == tonic::kNoError)
error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError();
if (error == tonic::kNoError) {
ftl::AutoResetWaitableEvent latch;
blink::Threads::UI()->PostTask([&error, &latch] {
error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError();
latch.Signal();
});
latch.Wait();
}
// The script has completed and the engine may not be in a clean state,
// so just stop the process.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册