Flutter Engine
 
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 *
44 * Block until the next task is ready and then perform it. May be interrupted by
45 * fl_task_runner_stop_wait(), in which case no task is run but execution will
46 * be returned to the caller.
47 *
48 * Must be called only by the GTK thread.
49 */
50void fl_task_runner_wait(FlTaskRunner* task_runner);
51
52/**
53 * fl_task_runner_stop_wait:
54 * @task_runner: an #FlTaskRunner.
55 *
56 * Cause fl_task_runner_wait() to complete. May be called even if
57 * fl_task_runner_wait() is not being used.
58 *
59 * May be called by any thread.
60 */
61void fl_task_runner_stop_wait(FlTaskRunner* self);
62
63G_END_DECLS
64
65#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_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)
void fl_task_runner_wait(FlTaskRunner *task_runner)