Flutter Engine
thread.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_PLATFORM_FUCHSIA_THREAD_H_
6 #define FLUTTER_SHELL_PLATFORM_FUCHSIA_THREAD_H_
7 
8 #include <lib/async-loop/cpp/loop.h>
9 #include <lib/async/default.h>
10 #include <pthread.h>
11 
12 #include <functional>
13 
14 #include "flutter/fml/macros.h"
15 
16 namespace flutter_runner {
17 
18 class Thread {
19  public:
20  Thread();
21 
22  ~Thread();
23 
24  void Quit();
25 
26  bool Join();
27 
28  bool IsValid() const;
29 
30  async_dispatcher_t* dispatcher() const;
31 
32  private:
33  bool valid_;
34  pthread_t thread_;
35  std::unique_ptr<async::Loop> loop_;
36 
37  void Main();
38 
39  FML_DISALLOW_COPY_AND_ASSIGN(Thread);
40 };
41 
42 } // namespace flutter_runner
43 
44 #endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_THREAD_H_
bool IsValid() const
Definition: thread.cc:75
async_dispatcher_t * dispatcher() const
Definition: thread.cc:79