| Advanced Gtk+ Sequencer Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <ags/thread/ags_returnable_thread.h> #define AGS_RETURNABLE_THREAD_DEFAULT_JIFFIE struct AgsReturnableThread;void (*AgsReturnableThreadCallback) (AgsReturnableThread *returnable_thread,); struct AgsReturnableThreadClass; enum AgsReturnableThreadFlags;gpointer datavoid ags_returnable_thread_connect_safe_run (AgsReturnableThread *returnable_thread,AgsReturnableThreadCallback callback);void ags_returnable_thread_disconnect_safe_run (AgsReturnableThread *returnable_thread); AgsReturnableThread * ags_returnable_thread_new ();GObject *thread_poolvoid ags_returnable_thread_safe_run (AgsReturnableThread *returnable_thread);
The AgsReturnableThread acts as thread. It should return after a short while because of limited thread pool.
struct AgsReturnableThread {
AgsThread thread;
volatile guint flags;
GObject *thread_pool;
pthread_mutex_t reset_mutex;
volatile void *safe_data;
gulong handler;
};
void (*AgsReturnableThreadCallback) (AgsReturnableThread *returnable_thread,);gpointer data
struct AgsReturnableThreadClass {
AgsThreadClass thread;
void (*safe_run)(AgsReturnableThread *returnable_thread);
};
typedef enum {
AGS_RETURNABLE_THREAD_IN_USE = 1,
AGS_RETURNABLE_THREAD_RESET = 1 << 1,
} AgsReturnableThreadFlags;
void ags_returnable_thread_connect_safe_run (AgsReturnableThread *returnable_thread,AgsReturnableThreadCallback callback);
Connects callback to thread.
|
the thread to connect |
|
the callback |
Since 0.4
void ags_returnable_thread_disconnect_safe_run (AgsReturnableThread *returnable_thread);
Disconnects callback of thread.
|
the thread to disconnect |
Since 0.4
AgsReturnableThread * ags_returnable_thread_new (GObject *thread_pool);
Create a new AgsReturnableThread.
|
the AgsThreadPool |
Returns : |
the new AgsReturnableThread |
Since 0.4
void ags_returnable_thread_safe_run (AgsReturnableThread *returnable_thread);