diff --git a/runtime/dart_isolate.cc b/runtime/dart_isolate.cc index 3dc8403506f7f..4af4758d6154a 100644 --- a/runtime/dart_isolate.cc +++ b/runtime/dart_isolate.cc @@ -633,10 +633,16 @@ bool DartIsolate::UpdateThreadPoolNames() const { } if (auto task_runner = task_runners.GetPlatformTaskRunner()) { + bool is_merged_platform_ui_thread = + task_runner == task_runners.GetUITaskRunner(); + std::string label; + if (is_merged_platform_ui_thread) { + label = task_runners.GetLabel() + std::string{".ui"}; + } else { + label = task_runners.GetLabel() + std::string{".platform"}; + } task_runner->PostTask( - [label = task_runners.GetLabel() + std::string{".platform"}]() { - Dart_SetThreadName(label.c_str()); - }); + [label = std::move(label)]() { Dart_SetThreadName(label.c_str()); }); } return true; diff --git a/shell/platform/android/android_shell_holder.cc b/shell/platform/android/android_shell_holder.cc index 49a969627d476..e86effe09bd92 100644 --- a/shell/platform/android/android_shell_holder.cc +++ b/shell/platform/android/android_shell_holder.cc @@ -89,17 +89,17 @@ AndroidShellHolder::AndroidShellHolder( static size_t thread_host_count = 1; auto thread_label = std::to_string(thread_host_count++); - auto mask = - ThreadHost::Type::kUi | ThreadHost::Type::kRaster | ThreadHost::Type::kIo; + auto mask = ThreadHost::Type::kRaster | ThreadHost::Type::kIo; + if (!settings.merged_platform_ui_thread) { + mask |= ThreadHost::Type::kUi; + } flutter::ThreadHost::ThreadHostConfig host_config( thread_label, mask, AndroidPlatformThreadConfigSetter); - if (!settings.merged_platform_ui_thread) { - host_config.ui_config = fml::Thread::ThreadConfig( - flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::kUi, thread_label), - fml::Thread::ThreadPriority::kDisplay); - } + host_config.ui_config = fml::Thread::ThreadConfig( + flutter::ThreadHost::ThreadHostConfig::MakeThreadName( + flutter::ThreadHost::Type::kUi, thread_label), + fml::Thread::ThreadPriority::kDisplay); host_config.raster_config = fml::Thread::ThreadConfig( flutter::ThreadHost::ThreadHostConfig::MakeThreadName( flutter::ThreadHost::Type::kRaster, thread_label), diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index b1ca5e66ae6d1..713d4fd0e288f 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -792,8 +792,10 @@ + (NSString*)generateThreadLabel:(NSString*)labelPrefix { // initialized. fml::MessageLoop::EnsureInitializedForCurrentThread(); - uint32_t threadHostType = flutter::ThreadHost::Type::kUi | flutter::ThreadHost::Type::kRaster | - flutter::ThreadHost::Type::kIo; + uint32_t threadHostType = flutter::ThreadHost::Type::kRaster | flutter::ThreadHost::Type::kIo; + if (!settings.enable_impeller) { + threadHostType |= flutter::ThreadHost::Type::kUi; + } if ([FlutterEngine isProfilerEnabled]) { threadHostType = threadHostType | flutter::ThreadHost::Type::kProfiler; @@ -802,13 +804,10 @@ + (NSString*)generateThreadLabel:(NSString*)labelPrefix { flutter::ThreadHost::ThreadHostConfig host_config(thread_label.UTF8String, threadHostType, IOSPlatformThreadConfigSetter); - if (!settings.enable_impeller) { - host_config.ui_config = - fml::Thread::ThreadConfig(flutter::ThreadHost::ThreadHostConfig::MakeThreadName( - flutter::ThreadHost::Type::kUi, thread_label.UTF8String), - fml::Thread::ThreadPriority::kDisplay); - } - + host_config.ui_config = + fml::Thread::ThreadConfig(flutter::ThreadHost::ThreadHostConfig::MakeThreadName( + flutter::ThreadHost::Type::kUi, thread_label.UTF8String), + fml::Thread::ThreadPriority::kDisplay); host_config.raster_config = fml::Thread::ThreadConfig(flutter::ThreadHost::ThreadHostConfig::MakeThreadName( flutter::ThreadHost::Type::kRaster, thread_label.UTF8String),