#include <event_loop.h>
Definition at line 20 of file event_loop.h.
◆ TaskExpiredCallback
◆ TaskTimePoint
◆ EventLoop() [1/2]
flutter::EventLoop::EventLoop |
( |
std::thread::id |
main_thread_id, |
|
|
const TaskExpiredCallback & |
on_task_expired |
|
) |
| |
Definition at line 12 of file event_loop.cc.
TaskExpiredCallback on_task_expired_
std::thread::id main_thread_id_
◆ ~EventLoop()
flutter::EventLoop::~EventLoop |
( |
| ) |
|
|
virtualdefault |
◆ EventLoop() [2/2]
flutter::EventLoop::EventLoop |
( |
const EventLoop & |
| ) |
|
|
delete |
◆ GetTaskQueueMutex()
std::mutex & flutter::EventLoop::GetTaskQueueMutex |
( |
| ) |
|
|
inlineprotected |
Definition at line 58 of file event_loop.h.
std::mutex task_queue_mutex_
◆ operator=()
◆ PostTask()
void flutter::EventLoop::PostTask |
( |
FlutterTask |
flutter_task, |
|
|
uint64_t |
flutter_target_time_nanos |
|
) |
| |
Definition at line 82 of file event_loop.cc.
83 {
84 static std::atomic_uint64_t sGlobalTaskOrder(0);
85
87 task.order = ++sGlobalTaskOrder;
89 task.task = flutter_task;
90
91 {
94
95
96
97
98
99 }
101}
static TaskTimePoint TimePointFromFlutterTime(uint64_t flutter_target_time_nanos)
std::priority_queue< Task, std::deque< Task >, Task::Comparer > task_queue_
◆ RunsTasksOnCurrentThread()
bool flutter::EventLoop::RunsTasksOnCurrentThread |
( |
| ) |
const |
◆ TimePointFromFlutterTime()
Definition at line 74 of file event_loop.cc.
75 {
76 const auto now = TaskTimePoint::clock::now();
77 const int64_t flutter_duration =
79 return now + std::chrono::nanoseconds(flutter_duration);
80}
uint64_t FlutterEngineGetCurrentTime()
Get the current time in nanoseconds from the clock used by the flutter engine. This is the system mon...
◆ WaitForEvents()
void flutter::EventLoop::WaitForEvents |
( |
std::chrono::nanoseconds |
max_wait = std::chrono::nanoseconds::max() | ) |
|
Definition at line 22 of file event_loop.cc.
22 {
23 const auto now = TaskTimePoint::clock::now();
24 std::vector<FlutterTask> expired_tasks;
25
26
27 {
31
32
33 if (top.fire_time > now) {
34 break;
35 }
36
37
38
39
40
42
43
45 }
46 }
47
48
49 {
50
51 for (const auto& task : expired_tasks) {
53 }
54 }
55
56
57
58 {
60 {
63 max_wait == std::chrono::nanoseconds::max() ? TaskTimePoint::max()
64 : now + max_wait;
66 ? TaskTimePoint::max()
68 next_wake = std::min(max_wake_timepoint, next_event_timepoint);
69 }
71 }
72}
virtual void WaitUntil(const TaskTimePoint &time)=0
std::chrono::steady_clock::time_point TaskTimePoint
◆ WaitUntil()
virtual void flutter::EventLoop::WaitUntil |
( |
const TaskTimePoint & |
time | ) |
|
|
protectedpure virtual |
◆ Wake()
virtual void flutter::EventLoop::Wake |
( |
| ) |
|
|
protectedpure virtual |
◆ main_thread_id_
std::thread::id flutter::EventLoop::main_thread_id_ |
|
protected |
◆ on_task_expired_
◆ task_queue_
◆ task_queue_mutex_
std::mutex flutter::EventLoop::task_queue_mutex_ |
|
protected |
The documentation for this class was generated from the following files: