AgsReturnableThread

AgsReturnableThread — returnable thread

Functions

Properties

GObject * thread-pool Read / Write

Signals

Types and Values

Object Hierarchy

    GObject
    ╰── AgsThread
        ╰── AgsReturnableThread

Implemented Interfaces

AgsReturnableThread implements AgsConnectable.

Includes

#include <ags/thread/ags_returnable_thread.h>

Description

The AgsReturnableThread acts as thread. It should return after a short while because of limited thread pool.

Functions

AgsReturnableThreadCallback ()

void
(*AgsReturnableThreadCallback) (AgsReturnableThread *returnable_thread,
                                gpointer data);

ags_returnable_thread_safe_run ()

void
ags_returnable_thread_safe_run (AgsReturnableThread *returnable_thread);

ags_returnable_thread_connect_safe_run ()

void
ags_returnable_thread_connect_safe_run
                               (AgsReturnableThread *returnable_thread,
                                AgsReturnableThreadCallback callback);

Connects callback to thread .

Parameters

returnable_thread

the thread to connect

 

callback

the callback

 

Since: 1.0.0


ags_returnable_thread_disconnect_safe_run ()

void
ags_returnable_thread_disconnect_safe_run
                               (AgsReturnableThread *returnable_thread);

Disconnects callback of thread .

Parameters

returnable_thread

the thread to disconnect

 

Since: 1.0.0


ags_returnable_thread_new ()

AgsReturnableThread *
ags_returnable_thread_new (GObject *thread_pool);

Create a new AgsReturnableThread.

Parameters

thread_pool

the AgsThreadPool

 

Returns

the new AgsReturnableThread

Since: 1.0.0


AGS_IS_RETURNABLE_THREAD()

#define AGS_IS_RETURNABLE_THREAD(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_RETURNABLE_THREAD))

AGS_RETURNABLE_THREAD()

#define AGS_RETURNABLE_THREAD(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_RETURNABLE_THREAD, AgsReturnableThread))

AGS_RETURNABLE_THREAD_CLASS()

#define AGS_RETURNABLE_THREAD_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST(class, AGS_TYPE_RETURNABLE_THREAD, AgsReturnableThreadClass))

AGS_RETURNABLE_THREAD_GET_CLASS()

#define AGS_RETURNABLE_THREAD_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS(obj, AGS_TYPE_RETURNABLE_THREAD, AgsReturnableThreadClass))

ags_returnable_thread_get_type ()

GType
ags_returnable_thread_get_type ();

Types and Values

AGS_RETURNABLE_THREAD_DEFAULT_JIFFIE

#define AGS_RETURNABLE_THREAD_DEFAULT_JIFFIE (AGS_THREAD_MAX_PRECISION)

enum AgsReturnableThreadFlags

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

Members

AGS_RETURNABLE_THREAD_IN_USE

the thread is in use

 

AGS_RETURNABLE_THREAD_RESET

not used

 

AGS_RETURNABLE_THREAD_RUN_ONCE

call AgsThread::run() only one time

 

AGS_TYPE_RETURNABLE_THREAD

#define AGS_TYPE_RETURNABLE_THREAD                (ags_returnable_thread_get_type())

struct AgsReturnableThread

struct AgsReturnableThread;

struct AgsReturnableThreadClass

struct AgsReturnableThreadClass {
  AgsThreadClass thread;

  void (*safe_run)(AgsReturnableThread *returnable_thread);
};

Property Details

The “thread-pool” property

  “thread-pool”              GObject *

The assigned AgsThreadPool providing default settings.

Flags: Read / Write

Since: 1.0.0

Signal Details

The “safe-run” signal

void
user_function (AgsReturnableThread *returnable_thread,
               gpointer             user_data)

The ::safe-run is invoked durin AgsThread::run as a context safe wrapper.

Parameters

returnable_thread

the AgsReturnableThread

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 1.0.0