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

Implemented Interfaces

AgsTaskLauncher implements AgsConnectable.

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_test_flags ()

gboolean
ags_task_launcher_test_flags (AgsTaskLauncher *task_launcher,
                              guint flags);

Test flags to be set on task_launcher .

Parameters

task_launcher

the AgsTaskLauncher

 

flags

the flags

 

Returns

TRUE if flags are set, else FALSE

Since: 3.0.0


ags_task_launcher_set_flags ()

void
ags_task_launcher_set_flags (AgsTaskLauncher *task_launcher,
                             guint flags);

Enable a feature of AgsTaskLauncher.

Parameters

task_launcher

the AgsTaskLauncher

 

flags

see enum AgsTaskLauncherFlags

 

Since: 3.0.0


ags_task_launcher_unset_flags ()

void
ags_task_launcher_unset_flags (AgsTaskLauncher *task_launcher,
                               guint flags);

Disable a feature of AgsTaskLauncher.

Parameters

task_launcher

the AgsTaskLauncher

 

flags

see enum AgsTaskLauncherFlags

 

Since: 3.0.0


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


AGS_IS_TASK_LAUNCHER()

#define AGS_IS_TASK_LAUNCHER(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_TASK_LAUNCHER))

AGS_IS_TASK_LAUNCHER_CLASS()

#define AGS_IS_TASK_LAUNCHER_CLASS(class)     (G_TYPE_CHECK_CLASS_TYPE ((class), AGS_TYPE_TASK_LAUNCHER))

AGS_TASK_LAUNCHER()

#define AGS_TASK_LAUNCHER(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_TASK_LAUNCHER, AgsTaskLauncher))

AGS_TASK_LAUNCHER_CLASS()

#define AGS_TASK_LAUNCHER_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST(class, AGS_TYPE_TASK_LAUNCHER, AgsTaskLauncher))

AGS_TASK_LAUNCHER_GET_CLASS()

#define AGS_TASK_LAUNCHER_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS(obj, AGS_TYPE_TASK_LAUNCHER, AgsTaskLauncherClass))

ags_task_launcher_get_type ()

GType
ags_task_launcher_get_type ();

Types and Values

AGS_TYPE_TASK_LAUNCHER_FLAGS

#define AGS_TYPE_TASK_LAUNCHER_FLAGS          (ags_task_launcher_flags_get_type())

AGS_TYPE_TASK_LAUNCHER

#define AGS_TYPE_TASK_LAUNCHER                (ags_task_launcher_get_type())

struct AgsTaskLauncher

struct AgsTaskLauncher;

struct AgsTaskLauncherClass

struct AgsTaskLauncherClass {
  GObjectClass gobject;

  void (*run)(AgsTaskLauncher *task_launcher);
};

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