## AgsTaskCompletion

AgsTaskCompletion — task completion

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_TASK_COMPLETION_GET_OBJ_MUTEX()
gboolean | ags_task_completion_test_flags ()
void | ags_task_completion_set_flags ()
void | ags_task_completion_unset_flags ()
void | ags_task_completion_complete ()
AgsTaskCompletion * | ags_task_completion_new ()

## Properties

GObject * | task | Read / Write

## Signals

void | complete | Run Last

## Types and Values

enum | AgsTaskCompletionFlags

## Object Hierarchy

        GFlags
        ╰── AgsTaskCompletionFlags
        GObject
        ╰── AgsTaskCompletion

## Includes

    #include <ags/thread/ags_task_completion.h>

## Description

The AgsTaskCompletion should be used to complete tasks from caller thread.

## Functions

### AGS_TASK_COMPLETION_GET_OBJ_MUTEX()

    #define AGS_TASK_COMPLETION_GET_OBJ_MUTEX(obj) (&(((AgsTaskCompletion *) obj)->obj_mutex))

### ags_task_completion_test_flags ()

    gboolean
    ags_task_completion_test_flags (AgsTaskCompletion *task_completion,
                                    AgsTaskCompletionFlags flags);

Test `flags` to be set on `task_completion` .

#### Parameters

task_completion | the AgsTaskCompletion |
flags | the flags |

#### Returns

`TRUE` if flags are set, else `FALSE`

Since: 3.0.0

### ags_task_completion_set_flags ()

    void
    ags_task_completion_set_flags (AgsTaskCompletion *task_completion,
                                   AgsTaskCompletionFlags flags);

Enable a feature of AgsTaskCompletion.

#### Parameters

task_completion | the AgsTaskCompletion |
flags | see enum AgsTaskCompletionFlags |

Since: 3.0.0

### ags_task_completion_unset_flags ()

    void
    ags_task_completion_unset_flags (AgsTaskCompletion *task_completion,
                                     AgsTaskCompletionFlags flags);

Disable a feature of AgsTaskCompletion.

#### Parameters

task_completion | the AgsTaskCompletion |
flags | see enum AgsTaskCompletionFlags |

Since: 3.0.0

### ags_task_completion_complete ()

    void
    ags_task_completion_complete (AgsTaskCompletion *task_completion);

Emit ::complete signal

#### Parameters

task_completion | the AgsTaskCompletion |

Since: 3.0.0

### ags_task_completion_new ()

    AgsTaskCompletion *
    ags_task_completion_new (GObject *task,
                             gpointer data);

Create a new instance of AgsTaskCompletion.

#### Parameters

task | the AgsTask |
data | pointer to user data |

#### Returns

the new AgsTaskCompletion

Since: 3.0.0

## Types and Values

### enum AgsTaskCompletionFlags

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

#### Members

AGS_TASK_COMPLETION_QUEUED | the assigned task has been queued |
AGS_TASK_COMPLETION_BUSY | the assigned task is busy |
AGS_TASK_COMPLETION_READY | the assigned task is ready |
AGS_TASK_COMPLETION_COMPLETED | the assigned task has been completed |

## Property Details

### The `“task”` property

      “task”                     GObject *

The assigned task.

Owner: AgsTaskCompletion

Flags: Read / Write

Since: 3.0.0

## Signal Details

### The `“complete”` signal

    void
    user_function (AgsTaskCompletion *task_completion,
                   gpointer           user_data)

The ::complete signal is emited as a task was finished

#### Parameters

task_completion | the object to complete. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.0.0