AgsTaskThread

AgsTaskThread — task thread

Functions

Properties

AgsThreadPool * thread-pool Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── AgsThread
        ╰── AgsTaskThread
            ╰── AgsRemoteTaskThread

Implemented Interfaces

AgsTaskThread implements AgsConnectable and AgsAsyncQueue.

Includes

#include <ags/thread/ags_task_thread.h>

Description

The AgsTaskThread acts as task queue thread.

Functions

ags_task_thread_append_task ()

void
ags_task_thread_append_task (AgsTaskThread *task_thread,
                             AgsTask *task);

Adds the task to task_thread .

Parameters

task_thread

an AgsTaskThread

 

task

an AgsTask

 

Since: 2.0.0


ags_task_thread_append_tasks ()

void
ags_task_thread_append_tasks (AgsTaskThread *task_thread,
                              GList *list);

Concats the list with task_thread 's internal task list. Don't free the list you pass. It will be freed for you.

Parameters

task_thread

an AgsTaskThread

 

list

a GList with AgsTask as data

 

Since: 2.0.0


ags_task_thread_append_cyclic_task ()

void
ags_task_thread_append_cyclic_task (AgsTaskThread *task_thread,
                                    AgsTask *task);

Add cyclic task.

Parameters

task_thread

the AgsTaskThread

 

task

the AgsTask

 

Since: 2.0.0


ags_task_thread_remove_cyclic_task ()

void
ags_task_thread_remove_cyclic_task (AgsTaskThread *task_thread,
                                    AgsTask *task);

Remove cyclic task.

Parameters

task_thread

the AgsTaskThread

 

task

the AgsTask

 

Since: 2.0.0


ags_task_thread_clear_cache ()

void
ags_task_thread_clear_cache (AgsTaskThread *task_thread);

Clear cache signal.

Parameters

task_thread

the AgsTaskThread

 

Since: 2.0.0


ags_task_thread_new ()

AgsTaskThread *
ags_task_thread_new ();

Create a new AgsTaskThread.

Returns

the new AgsTaskThread

Since: 2.0.0


AGS_IS_TASK_THREAD()

#define AGS_IS_TASK_THREAD(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_TASK_THREAD))

AGS_TASK_THREAD()

#define AGS_TASK_THREAD(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_TASK_THREAD, AgsTaskThread))

AGS_TASK_THREAD_CLASS()

#define AGS_TASK_THREAD_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST(class, AGS_TYPE_TASK_THREAD, AgsTaskThread))

AGS_TASK_THREAD_GET_CLASS()

#define AGS_TASK_THREAD_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS(obj, AGS_TYPE_TASK_THREAD, AgsTaskThreadClass))

ags_task_thread_get_type ()

GType
ags_task_thread_get_type ();

Types and Values

AGS_TASK_THREAD_RT_PRIORITY

#define AGS_TASK_THREAD_RT_PRIORITY (95)

AGS_TASK_THREAD_DEFAULT_JIFFIE

#define AGS_TASK_THREAD_DEFAULT_JIFFIE (AGS_THREAD_DEFAULT_MAX_PRECISION)

enum AgsTaskThreadFlags

Enum values to control the behavior or indicate internal state of AgsTaskThread by enable/disable as flags.

Members

AGS_TASK_THREAD_EXTERN_SYNC

sync with external thread

 

AGS_TASK_THREAD_EXTERN_READY

sync with exeternal thread ready

 

AGS_TASK_THREAD_EXTERN_AVAILABLE

the external thread is available

 

AGS_TASK_THREAD_SYNC_WAIT

sync external thread wait - producer

 

AGS_TASK_THREAD_SYNC_DONE

sync external thread done - producer

 

AGS_TASK_THREAD_EXTERN_SYNC_WAIT

sync external thread wait - consumer

 

AGS_TASK_THREAD_EXTERN_SYNC_DONE

sync external thread done - consumer

 

struct AgsTaskThreadAppend

struct AgsTaskThreadAppend {
  volatile AgsTaskThread *task_thread;
  volatile gpointer data;
};

AgsTaskThreadAppend is used to add tasks non-blocking.

Members

volatile AgsTaskThread *task_thread;

the AgsTaskThread

 

volatile gpointer data;

the AgsTask

 

AGS_TYPE_TASK_THREAD

#define AGS_TYPE_TASK_THREAD                (ags_task_thread_get_type())

struct AgsTaskThread

struct AgsTaskThread;

struct AgsTaskThreadClass

struct AgsTaskThreadClass {
  AgsThreadClass thread;

  void (*clear_cache)(AgsTaskThread *task_thread);
};

Property Details

The “thread-pool” property

  “thread-pool”              AgsThreadPool *

The assigned AgsThreadPool to do non-blocking calls.

Flags: Read / Write

Since: 2.0.0

Signal Details

The “clear-cache” signal

void
user_function (AgsTaskThread *task_thread,
               gpointer       user_data)

The ::clear-cache signal is invoked to clear the cache libraries might have been allocated.

Parameters

task_thread

the object playing.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 2.0.0