Debian Codegraph @

src/dex-task-group.h

raw symbols SCIP
1 /*
2 * dex-task-group.h
3 *
4 * Copyright 2026 Christian Hergert
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1 of the
9 * License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library; if not, see <http://www.gnu.org/licenses/>.
18 *
19 * SPDX-License-Identifier: LGPL-2.1-or-later
20 */
21
22 #pragma once
23
24 #if !defined (DEX_INSIDE) && !defined (DEX_COMPILATION)
25 # error "Only <libdex.h> can be included directly."
26 #endif
27
28 #include "dex-future.h"
29
30 G_BEGIN_DECLS
31
32 #define DEX_TYPE_TASK_GROUP (dex_task_group_get_type())
33 #define DEX_TASK_GROUP(object) (G_TYPE_CHECK_INSTANCE_CAST(object, DEX_TYPE_TASK_GROUP, DexTaskGroup))
34 #define DEX_IS_TASK_GROUP(object) (G_TYPE_CHECK_INSTANCE_TYPE(object, DEX_TYPE_TASK_GROUP))
35
36 typedef struct _DexTaskGroup DexTaskGroup;
37
38 typedef enum _DexTaskGroupFlags
39 {
40 DEX_TASK_GROUP_FLAGS_NONE = 0,
41 DEX_TASK_GROUP_FLAGS_CANCEL_ON_ERROR = 1 << 0,
42 } DexTaskGroupFlags;
43
44 DEX_AVAILABLE_IN_ALL
45 GType dex_task_group_get_type (void);
46 DEX_AVAILABLE_IN_ALL
47 DexTaskGroup *dex_task_group_new (DexTaskGroupFlags flags);
48 DEX_AVAILABLE_IN_ALL
49 gboolean dex_task_group_add (DexTaskGroup *group,
50 DexFuture *future);
51 DEX_AVAILABLE_IN_ALL
52 DexFuture *dex_task_group_close (DexTaskGroup *group) G_GNUC_WARN_UNUSED_RESULT;
53 DEX_AVAILABLE_IN_ALL
54 void dex_task_group_cancel (DexTaskGroup *group);
55 DEX_AVAILABLE_IN_ALL
56 void dex_task_group_push_thread_default (DexTaskGroup *group);
57 DEX_AVAILABLE_IN_ALL
58 void dex_task_group_pop_thread_default (DexTaskGroup *group);
59
60 G_DEFINE_AUTOPTR_CLEANUP_FUNC (DexTaskGroup, dex_unref)
61
62 G_END_DECLS