AgsTaskThread

AgsTaskThread — task thread

Synopsis

#include <ags/thread/ags_task_thread.h>

#define             AGS_TASK_THREAD_DEFAULT_JIFFIE
struct              AgsTaskThread;
struct              AgsTaskThreadAppend;
struct              AgsTaskThreadClass;
void                ags_task_thread_append_task         (AgsTaskThread *task_thread,
                                                         AgsTask *task);
void                ags_task_thread_append_tasks        (AgsTaskThread *task_thread,
                                                         GList *list);
AgsTaskThread *     ags_task_thread_new                 (GObject *devout);

Description

The AgsTaskThread acts as task queue thread.

Details

AGS_TASK_THREAD_DEFAULT_JIFFIE

#define AGS_TASK_THREAD_DEFAULT_JIFFIE (1000)

struct AgsTaskThread

struct AgsTaskThread {
  AgsThread thread;

  guint flags;

  GMutex mutex;
  GCond cond;

  pthread_mutex_t read_mutex;
  pthread_mutex_t launch_mutex;

  volatile guint queued;
  volatile guint pending;

  volatile GList *exec;
  volatile GList *queue;

  AgsThreadPool *thread_pool;
};

struct AgsTaskThreadAppend

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

struct AgsTaskThreadClass

struct AgsTaskThreadClass {
  AgsThreadClass thread;
};

ags_task_thread_append_task ()

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

Adds the task to task_thread.

task_thread :

an AgsTaskThread

task :

an AgsTask

Since 0.4


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.

task_thread :

an AgsTaskThread

list :

a GList with AgsTask as data

Since 0.4


ags_task_thread_new ()

AgsTaskThread *     ags_task_thread_new                 (GObject *devout);

Create a new AgsTaskThread.

devout :

the AgsDevout

Returns :

the new AgsTaskThread

Since 0.4