JULEA
Data Structures | Typedefs | Functions
Background Operation

Data Structures

struct  JBackgroundOperation
 

Typedefs

typedef struct JBackgroundOperation JBackgroundOperation
 
typedef gpointer(* JBackgroundOperationFunc) (gpointer)
 

Functions

JBackgroundOperationj_background_operation_new (JBackgroundOperationFunc func, gpointer data)
 
JBackgroundOperationj_background_operation_ref (JBackgroundOperation *background_operation)
 
void j_background_operation_unref (JBackgroundOperation *background_operation)
 
gpointer j_background_operation_wait (JBackgroundOperation *background_operation)
 
void j_background_operation_init (guint count)
 
void j_background_operation_fini (void)
 
guint j_background_operation_get_num_threads (void)
 

Detailed Description

Typedef Documentation

◆ JBackgroundOperation

◆ JBackgroundOperationFunc

typedef gpointer(* JBackgroundOperationFunc) (gpointer)

Function Documentation

◆ j_background_operation_fini()

void j_background_operation_fini ( void  )

Shuts down the background operation framework.

G_GNUC_INTERNAL void j_background_operation_fini(void)
Definition: jbackground-operation.c:133

◆ j_background_operation_get_num_threads()

guint j_background_operation_get_num_threads ( void  )

Gets the number of threads used.

◆ j_background_operation_init()

void j_background_operation_init ( guint  count)

Initializes the background operation framework.

G_BEGIN_DECLS G_GNUC_INTERNAL void j_background_operation_init(guint count)
Definition: jbackground-operation.c:115

◆ j_background_operation_new()

JBackgroundOperation * j_background_operation_new ( JBackgroundOperationFunc  func,
gpointer  data 
)

Creates a new background operation.

static
gpointer
background_func (gpointer data)
{
return NULL;
}
JBackgroundOperation* background_operation;
background_operation = j_background_operation_new(background_func, NULL);
JBackgroundOperation * j_background_operation_new(JBackgroundOperationFunc func, gpointer data)
Definition: jbackground-operation.c:156
Definition: jbackground-operation.c:45
Parameters
funcA function to execute in the background.
dataUser data given to func.
Returns
A new background operation. Should be freed with j_background_operation_unref().

◆ j_background_operation_ref()

JBackgroundOperation * j_background_operation_ref ( JBackgroundOperation background_operation)

Increases a background operation's reference count.

JBackgroundOperation* background_operation;
j_background_operation_ref(background_operation);
JBackgroundOperation * j_background_operation_ref(JBackgroundOperation *background_operation)
Definition: jbackground-operation.c:180
Parameters
background_operationA background operation.
Returns
background_operation.

◆ j_background_operation_unref()

void j_background_operation_unref ( JBackgroundOperation background_operation)

Decreases a background operation's reference count. When the reference count reaches zero, frees the memory allocated for the background operation.

JBackgroundOperation* background_operation;
j_background_operation_unref(background_operation);
void j_background_operation_unref(JBackgroundOperation *background_operation)
Definition: jbackground-operation.c:192
Parameters
background_operationA background operation.

◆ j_background_operation_wait()

gpointer j_background_operation_wait ( JBackgroundOperation background_operation)

Waits for a background operation to finish.

JBackgroundOperation* background_operation;
j_background_operation_wait(background_operation);
gpointer j_background_operation_wait(JBackgroundOperation *background_operation)
Definition: jbackground-operation.c:208
Parameters
background_operationA background operation.
Returns
The return value of the function given to j_background_operation_new().