Debian Codegraph @

src/dex-thread-storage-private.h

raw symbols SCIP
1 /*
2 * dex-thread-storage-private.h
3 *
4 * Copyright 2022 Christian Hergert <[email protected]>
5 *
6 * This library is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as
8 * 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 General Public License along
17 * with this program. 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 #include <glib.h>
25
26 G_BEGIN_DECLS
27
28 #define DEX_THREAD_POOL_WORKER_CURRENT (dex_thread_storage_get()->worker)
29 #define DEX_DISPATCH_RECURSE_MAX 4
30
31 typedef struct _DexAioContext DexAioContext;
32 typedef struct _DexCoroutineScheduler DexCoroutineScheduler;
33 typedef struct _DexFiberScheduler DexFiberScheduler;
34 typedef struct _DexScheduler DexScheduler;
35 typedef struct _DexThreadPoolWorker DexThreadPoolWorker;
36
37 typedef struct _DexThreadStorage
38 {
39 DexScheduler *scheduler;
40 gpointer task_group;
41 DexThreadPoolWorker *worker;
42 DexAioContext *aio_context;
43 DexFiberScheduler *fiber_scheduler;
44 DexCoroutineScheduler *coroutine_scheduler;
45 guint sync_dispatch_depth;
46 } DexThreadStorage;
47
48 DexThreadStorage *dex_thread_storage_get (void);
49 DexThreadStorage *dex_thread_storage_peek (void);
50
51 G_END_DECLS