| 1 | /* |
| 2 | * dex-work-queue-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 "dex-scheduler-private.h" |
| 25 | |
| 26 | G_BEGIN_DECLS |
| 27 | |
| 28 | #define DEX_TYPE_WORK_QUEUE (dex_work_queue_get_type()) |
| 29 | #define DEX_WORK_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, DEX_TYPE_WORK_QUEUE, DexWorkQueue)) |
| 30 | #define DEX_IS_WORK_QUEUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, DEX_TYPE_WORK_QUEUE)) |
| 31 | |
| 32 | typedef struct _DexWorkQueue DexWorkQueue; |
| 33 | |
| 34 | GType dex_work_queue_get_type (void); |
| 35 | DexWorkQueue *dex_work_queue_new (void); |
| 36 | void dex_work_queue_push (DexWorkQueue *work_queue, |
| 37 | DexWorkItem work_item); |
| 38 | gboolean dex_work_queue_try_pop (DexWorkQueue *work_queue, |
| 39 | DexWorkItem *out_work_item); |
| 40 | DexFuture *dex_work_queue_run (DexWorkQueue *work_queue); |
| 41 | |
| 42 | G_END_DECLS |