AgsTaskLauncher

AgsTaskLauncher — task launcher thread-safe context within tree

Stability Level

Stable, unless otherwise indicated

Functions

Properties

gpointer cyclic-task Read / Write
gpointer task Read / Write

Signals

void run Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── AgsTaskLauncher

Includes

#include <ags/thread/ags_task_launcher.h>

Description

The AgsTaskLauncher acts as task launcher. The task launcher provides you a thread-safe context within tree tree.

It might be used to inject work from one thread to another, too.

AgsTaskLauncher::run() is called from AgsThread::clock() default implementation.

There are some threads providing injection via dedicated AgsTaskLauncher.

Functions

AGS_TASK_LAUNCHER_GET_OBJ_MUTEX()

#define AGS_TASK_LAUNCHER_GET_OBJ_MUTEX(obj) (&(((AgsTaskLauncher *) obj)->obj_mutex))

ags_task_launcher_attach ()

void
ags_task_launcher_attach (AgsTaskLauncher *task_launcher,
                          GMainContext *main_context);

Attach task_launcher to main_context .

Parameters

task_launcher

the AgsTaskLauncher

 

main_context

the GMainContext

 

Since: 3.0.0


ags_task_launcher_add_task ()

void
ags_task_launcher_add_task (AgsTaskLauncher *task_launcher,
                            AgsTask *task);

Add task to task_launcher .

Parameters

task_launcher

the AgsTaskLauncher

 

task

the AgsTask

 

Since: 3.0.0


ags_task_launcher_add_task_all ()

void
ags_task_launcher_add_task_all (AgsTaskLauncher *task_launcher,
                                GList *list);

Add all list to task_launcher .

Parameters

task_launcher

the AgsTaskLauncher

 

list

the GList containing AgsTask.

[element-type Ags.Task][transfer none]

Since: 3.0.0


ags_task_launcher_add_cyclic_task ()

void
ags_task_launcher_add_cyclic_task (AgsTaskLauncher *task_launcher,
                                   AgsTask *cyclic_task);

Add cyclic_task to task_launcher .

Parameters

task_launcher

the AgsTaskLauncher

 

cyclic_task

the cyclic AgsTask

 

Since: 3.0.0


ags_task_launcher_remove_cyclic_task ()

void
ags_task_launcher_remove_cyclic_task (AgsTaskLauncher *task_launcher,
                                      AgsTask *cyclic_task);

Remove cyclic_task from task_launcher .

Parameters

task_launcher

the AgsTaskLauncher

 

cyclic_task

the cyclic AgsTask

 

Since: 3.0.0


ags_task_launcher_run ()

void
ags_task_launcher_run (AgsTaskLauncher *task_launcher);

Run tasks.

Parameters

task_launcher

the AgsTaskLauncher

 

Since: 3.0.0


ags_task_launcher_sync_run ()

void
ags_task_launcher_sync_run (AgsTaskLauncher *task_launcher);

Sync run tasks.

Parameters

task_launcher

the AgsTaskLauncher

 

Since: 3.0.0


ags_task_launcher_new ()

AgsTaskLauncher *
ags_task_launcher_new ();

Create a new AgsTaskLauncher.

Returns

the new AgsTaskLauncher

Since: 3.0.0

Types and Values

AGS_TYPE_TASK_LAUNCHER_FLAGS

#define AGS_TYPE_TASK_LAUNCHER_FLAGS          (ags_task_launcher_flags_get_type())

Property Details

The “cyclic-task” property

  “cyclic-task”              gpointer

The assigned cyclic AgsTask to launch.

[transfer full]

Owner: AgsTaskLauncher

Flags: Read / Write

Since: 3.0.0


The “task” property

  “task”                     gpointer

The assigned AgsTask to launch.

[transfer full]

Owner: AgsTaskLauncher

Flags: Read / Write

Since: 3.0.0

Signal Details

The “run” signal

void
user_function (AgsTaskLauncher *task_launcher,
               gpointer         user_data)

The ::run signal is invoked to run “task”

Parameters

task_launcher

the AgsTaskLauncher

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.0.0