Commit cd6ae66a authored by Christian Hergert's avatar Christian Hergert

task: add ide_task_get_return_on_cancel()

parent fc35b276
Pipeline #6701 failed with stage
in 60 minutes and 7 seconds
......@@ -1790,6 +1790,28 @@ ide_task_cancellable_cancelled_cb (GCancellable *cancellable,
g_source_unref (source);
}
/**
* ide_task_get_return_on_cancel:
* @self: a #IdeTask
*
* Gets the return_on_cancel value, which means the task will return
* immediately when the #GCancellable is cancelled.
*/
gboolean
ide_task_get_return_on_cancel (IdeTask *self)
{
IdeTaskPrivate *priv = ide_task_get_instance_private (self);
gboolean ret;
g_return_val_if_fail (IDE_IS_TASK (self), FALSE);
g_mutex_lock (&priv->mutex);
ret = priv->return_on_cancel;
g_mutex_unlock (&priv->mutex);
return ret;
}
/**
* ide_task_set_return_on_cancel:
* @self: a #IdeTask
......
......@@ -109,6 +109,8 @@ IDE_AVAILABLE_IN_3_28
void ide_task_return_int (IdeTask *self,
gssize result);
IDE_AVAILABLE_IN_3_28
gboolean ide_task_get_return_on_cancel (IdeTask *self);
IDE_AVAILABLE_IN_3_28
void ide_task_return_new_error (IdeTask *self,
GQuark error_domain,
gint error_code,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment