AgsWorkerThread

AgsWorkerThread — worker thread

Functions

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── AgsThread
        ╰── AgsWorkerThread
            ╰── AgsDestroyWorker

Implemented Interfaces

AgsWorkerThread implements AgsConnectable.

Includes

#include <ags/thread/ags_worker_thread.h>

Description

The AgsWorkerThread does non-realtime work. You might want to synchronize to the run signal within your ::do_poll() method.

Functions

ags_woker_thread_do_poll_loop ()

void *
ags_woker_thread_do_poll_loop (void *ptr);

Do loop and invoke ags_worker_thread_do_poll() unless flag AGS_WORKER_THREAD_RUNNING was unset.

Parameters

ptr

the AgsWorkerThread

 

Since: 1.0.0.8


ags_worker_thread_do_poll ()

void
ags_worker_thread_do_poll (AgsWorkerThread *worker_thread);

Do poll your work. It is called of the worker thread.

Parameters

worker_thread

the AgsWorkerThread

 

Since: 1.0.0.8


ags_worker_thread_new ()

AgsWorkerThread *
ags_worker_thread_new ();

Create a new AgsWorkerThread.

Returns

the new AgsWorkerThread

Since: 1.0.0.8


AGS_IS_WORKER_THREAD()

#define AGS_IS_WORKER_THREAD(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_WORKER_THREAD))

AGS_WORKER_THREAD()

#define AGS_WORKER_THREAD(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_WORKER_THREAD, AgsWorkerThread))

AGS_WORKER_THREAD_CLASS()

#define AGS_WORKER_THREAD_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST(class, AGS_TYPE_WORKER_THREAD, AgsWorkerThreadClass))

AGS_WORKER_THREAD_GET_CLASS()

#define AGS_WORKER_THREAD_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS(obj, AGS_TYPE_WORKER_THREAD, AgsWorkerThreadClass))

ags_worker_thread_get_type ()

GType
ags_worker_thread_get_type ();

Types and Values

AGS_WORKER_THREAD_DEFAULT_JIFFIE

#define AGS_WORKER_THREAD_DEFAULT_JIFFIE (AGS_THREAD_MAX_PRECISION)

enum AgsWorkerThreadFlags

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

Members

AGS_WORKER_THREAD_RUNNING

the worker is running

 

AGS_WORKER_THREAD_RUN_WAIT

sync wait

 

AGS_WORKER_THREAD_RUN_DONE

sync done

 

AGS_WORKER_THREAD_RUN_SYNC

do sync

 

AGS_TYPE_WORKER_THREAD

#define AGS_TYPE_WORKER_THREAD                (ags_worker_thread_get_type())

struct AgsWorkerThread

struct AgsWorkerThread;

struct AgsWorkerThreadClass

struct AgsWorkerThreadClass {
  AgsThreadClass thread;

  void (*do_poll)(AgsWorkerThread *worker_thread);
};

Signal Details

The “do-poll” signal

void
user_function (AgsWorkerThread *thread,
               gpointer         user_data)

The ::do_poll() signal runs independently of ::run() but might be synchronized using a conditional lock.

Parameters

thread

the AgsWorkerThread

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0.8