Flutter Engine
thread_host.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef FLUTTER_SHELL_COMMON_THREAD_HOST_H_
6 #define FLUTTER_SHELL_COMMON_THREAD_HOST_H_
7 
8 #include <memory>
9 
10 #include "flutter/fml/macros.h"
11 #include "flutter/fml/thread.h"
12 
13 namespace flutter {
14 
15 /// The collection of all the threads used by the engine.
16 struct ThreadHost {
17  enum Type {
18  Platform = 1 << 0,
19  UI = 1 << 1,
20  RASTER = 1 << 2,
21  IO = 1 << 3,
22  Profiler = 1 << 4,
23  };
24 
25  std::string name_prefix;
26  std::unique_ptr<fml::Thread> platform_thread;
27  std::unique_ptr<fml::Thread> ui_thread;
28  std::unique_ptr<fml::Thread> raster_thread;
29  std::unique_ptr<fml::Thread> io_thread;
30  std::unique_ptr<fml::Thread> profiler_thread;
31 
32  ThreadHost();
33 
35 
36  ThreadHost& operator=(ThreadHost&&) = default;
37 
38  ThreadHost(std::string name_prefix, uint64_t type_mask);
39 
40  ~ThreadHost();
41 };
42 
43 } // namespace flutter
44 
45 #endif // FLUTTER_SHELL_COMMON_THREAD_HOST_H_
std::unique_ptr< fml::Thread > ui_thread
Definition: thread_host.h:27
std::unique_ptr< fml::Thread > profiler_thread
Definition: thread_host.h:30
ThreadHost & operator=(ThreadHost &&)=default
The collection of all the threads used by the engine.
Definition: thread_host.h:16
std::string name_prefix
Definition: thread_host.h:25
std::unique_ptr< fml::Thread > io_thread
Definition: thread_host.h:29
std::unique_ptr< fml::Thread > raster_thread
Definition: thread_host.h:28
std::unique_ptr< fml::Thread > platform_thread
Definition: thread_host.h:26