AgsReturnableThread

AgsReturnableThread — returnable thread

Stability Level

Stable, unless otherwise indicated

Functions

Properties

GObject * thread-pool Read / Write

Signals

Types and Values

Object Hierarchy

    GFlags
    ╰── AgsReturnableThreadFlags
    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

AGS_RETURNABLE_THREAD_GET_RESET_MUTEX()

#define AGS_RETURNABLE_THREAD_GET_RESET_MUTEX(obj) (&(((AgsReturnableThread *) obj)->reset_mutex))

AgsReturnableThreadCallback ()

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

ags_returnable_thread_test_flags ()

gboolean
ags_returnable_thread_test_flags (AgsReturnableThread *returnable_thread,
                                  AgsReturnableThreadFlags flags);

Test flags to be set on returnable_thread .

Parameters

returnable_thread

the AgsReturnableThread

 

flags

the flags

 

Returns

TRUE if flags are set, else FALSE

Since: 3.0.0


ags_returnable_thread_set_flags ()

void
ags_returnable_thread_set_flags (AgsReturnableThread *returnable_thread,
                                 AgsReturnableThreadFlags flags);

Set flags.

Parameters

returnable_thread

the AgsReturnableThread

 

flags

the flags

 

Since: 3.0.0


ags_returnable_thread_unset_flags ()

void
ags_returnable_thread_unset_flags (AgsReturnableThread *returnable_thread,
                                   AgsReturnableThreadFlags flags);

Unset flags.

Parameters

returnable_thread

the AgsReturnableThread

 

flags

the flags

 

Since: 3.0.0


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.

[scope call]

Since: 3.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: 3.0.0


ags_returnable_thread_new ()

AgsReturnableThread *
ags_returnable_thread_new (GObject *thread_pool);

Create a new instance of AgsReturnableThread.

Parameters

thread_pool

the AgsThreadPool

 

Returns

the new AgsReturnableThread

Since: 3.0.0


AGS_IS_RETURNABLE_THREAD()

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

AGS_IS_RETURNABLE_THREAD_CLASS()

#define AGS_IS_RETURNABLE_THREAD_CLASS(class)     (G_TYPE_CHECK_CLASS_TYPE ((class), 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_flags_get_type ()

GType
ags_returnable_thread_flags_get_type ();

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

AGS_TYPE_RETURNABLE_THREAD_FLAGS

#define AGS_TYPE_RETURNABLE_THREAD_FLAGS          (ags_returnable_thread_flags_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.

Owner: AgsReturnableThread

Flags: Read / Write

Since: 3.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: 3.0.0