Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
fl_task_runner.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_LINUX_FL_TASK_RUNNER_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_TASK_RUNNER_H_
7
8#include <glib-object.h>
9
12
13G_BEGIN_DECLS
14
15G_DECLARE_FINAL_TYPE(FlTaskRunner, fl_task_runner, FL, TASK_RUNNER, GObject);
16
17/**
18 * fl_task_runner_new:
19 * @engine: the #FlEngine owning the task runner.
20 *
21 * Creates new task runner instance.
22 *
23 * Returns: an #FlTaskRunner.
24 */
25FlTaskRunner* fl_task_runner_new(FlEngine* engine);
26
27/**
28 * fl_task_runner_post_flutter_task:
29 * @task_runner: an #FlTaskRunner.
30 * @task: Flutter task being scheduled
31 * @target_time_nanos: absolute time in nanoseconds
32 *
33 * Posts a Flutter task to be executed on main thread. This function is thread
34 * safe and may be called from any thread.
35 */
36void fl_task_runner_post_flutter_task(FlTaskRunner* task_runner,
37 FlutterTask task,
38 uint64_t target_time_nanos);
39
40/**
41 * fl_task_runner_wait:
42 * @task_runner: an #FlTaskRunner.
43 * @expiry_time: absolute time in microseconds to stop waiting.
44 *
45 * Block until the next task is ready and then perform it. May be interrupted by
46 * fl_task_runner_stop_wait(), in which case no task is run but execution will
47 * be returned to the caller.
48 *
49 * Must be called only by the GTK thread.
50 */
51void fl_task_runner_wait(FlTaskRunner* task_runner, gint64 expiry_time);
52
53/**
54 * fl_task_runner_stop_wait:
55 * @task_runner: an #FlTaskRunner.
56 *
57 * Cause fl_task_runner_wait() to complete. May be called even if
58 * fl_task_runner_wait() is not being used.
59 *
60 * May be called by any thread.
61 */
62void fl_task_runner_stop_wait(FlTaskRunner* self);
63
64G_END_DECLS
65
66#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_TASK_RUNNER_H_
FlutterEngine engine
Definition main.cc:84
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlTaskRunner, fl_task_runner, FL, TASK_RUNNER, GObject)
void fl_task_runner_wait(FlTaskRunner *task_runner, gint64 expiry_time)
void fl_task_runner_stop_wait(FlTaskRunner *self)
FlTaskRunner * fl_task_runner_new(FlEngine *engine)
void fl_task_runner_post_flutter_task(FlTaskRunner *task_runner, FlutterTask task, uint64_t target_time_nanos)