5#include "flutter/shell/common/thread_host.h"
17 const std::string& prefix) {
20 return prefix +
".platform";
22 return prefix +
".ui";
24 return prefix +
".io";
26 return prefix +
".raster";
28 return prefix +
".profiler";
45 platform_config = config;
50 raster_config = config;
56 profiler_config = config;
59std::unique_ptr<fml::Thread> ThreadHost::CreateThread(
61 std::optional<ThreadConfig> thread_config,
64 if (!thread_config.has_value()) {
68 return std::make_unique<fml::Thread>(host_config.
config_setter,
69 thread_config.value());
80 : name_prefix(host_config.name_prefix) {
fml::Thread::ThreadConfig ThreadConfig
std::optional< ThreadConfig > platform_config
std::optional< ThreadConfig > io_config
void SetUIConfig(const ThreadConfig &)
Specified the UI Thread Config, meanwhile set the mask.
const ThreadConfigSetter config_setter
void SetProfilerConfig(const ThreadConfig &)
Specified the ProfilerThread Config, meanwhile set the mask.
std::optional< ThreadConfig > ui_config
std::optional< ThreadConfig > raster_config
static std::string MakeThreadName(Type type, const std::string &prefix)
Use the prefix and thread type to generator a thread name.
void SetIOConfig(const ThreadConfig &)
Specified the IO Thread Config, meanwhile set the mask.
void SetRasterConfig(const ThreadConfig &)
Specified the IO Thread Config, meanwhile set the mask.
bool isThreadNeeded(Type type) const
Check if need to create thread.
std::optional< ThreadConfig > profiler_config
void SetPlatformConfig(const ThreadConfig &)
Specified the Platform Thread Config, meanwhile set the mask.
The collection of all the threads used by the engine.
std::unique_ptr< fml::Thread > io_thread
std::unique_ptr< fml::Thread > platform_thread
std::unique_ptr< fml::Thread > profiler_thread
std::unique_ptr< fml::Thread > raster_thread
std::unique_ptr< fml::Thread > ui_thread
The ThreadConfig is the thread info include thread name, thread priority.