未验证 提交 0fa87b46 编写于 作者: R rogeryi 提交者: GitHub

Fix Android IO and Worker threads priority issue (#23911)

上级 a549c540
......@@ -122,6 +122,11 @@ AndroidShellHolder::AndroidShellHolder(
FML_LOG(ERROR) << "Failed to set UI task runner priority";
}
});
task_runners.GetIOTaskRunner()->PostTask([]() {
if (::setpriority(PRIO_PROCESS, gettid(), 1) != 0) {
FML_LOG(ERROR) << "Failed to set IO task runner priority";
}
});
shell_ =
Shell::Create(GetDefaultPlatformData(), // window data
......@@ -131,6 +136,14 @@ AndroidShellHolder::AndroidShellHolder(
on_create_rasterizer // rasterizer create callback
);
if (shell_) {
shell_->GetDartVM()->GetConcurrentMessageLoop()->PostTaskToAllWorkers([]() {
if (::setpriority(PRIO_PROCESS, gettid(), 1) != 0) {
FML_LOG(ERROR) << "Failed to set Workers task runner priority";
}
});
}
platform_view_ = weak_platform_view;
FML_DCHECK(platform_view_);
is_valid_ = shell_ != nullptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册