5#ifndef FLUTTER_SHELL_COMMON_THREAD_HOST_H_
6#define FLUTTER_SHELL_COMMON_THREAD_HOST_H_
12#include "flutter/fml/macros.h"
13#include "flutter/fml/thread.h"
102 std::unique_ptr<fml::Thread> CreateThread(
104 std::optional<ThreadConfig> thread_config,
std::function< void(const ThreadConfig &)> ThreadConfigSetter
static void SetCurrentThreadName(const ThreadConfig &config)
fml::Thread::ThreadConfig ThreadConfig
fml::Thread::ThreadConfigSetter ThreadConfigSetter
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.
ThreadHostConfig(const std::string &name_prefix, uint64_t mask, const ThreadConfigSetter &setter=fml::Thread::SetCurrentThreadName)
ThreadHostConfig(const ThreadConfigSetter &setter=fml::Thread::SetCurrentThreadName)
std::optional< ThreadConfig > ui_config
std::optional< ThreadConfig > raster_config
ThreadHostConfig(uint64_t mask, const ThreadConfigSetter &setter=fml::Thread::SetCurrentThreadName)
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.
ThreadHost & operator=(ThreadHost &&)=default
std::unique_ptr< fml::Thread > io_thread
std::unique_ptr< fml::Thread > platform_thread
ThreadHost(ThreadHost &&)
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.