From 6f0f7d1b40a8fa8d46a2d6f4317600001cdbbb18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:57:27 +0200 Subject: Adding upstream version 43.5. Signed-off-by: Daniel Baumann --- lib/gs-worker-thread.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/gs-worker-thread.h (limited to 'lib/gs-worker-thread.h') diff --git a/lib/gs-worker-thread.h b/lib/gs-worker-thread.h new file mode 100644 index 0000000..36b28df --- /dev/null +++ b/lib/gs-worker-thread.h @@ -0,0 +1,41 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- + * vi:set noexpandtab tabstop=8 shiftwidth=8: + * + * Copyright (C) 2021 Endless OS Foundation LLC + * + * Author: Philip Withnall + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#pragma once + +#include +#include +#include + +G_BEGIN_DECLS + +#define GS_TYPE_WORKER_THREAD (gs_worker_thread_get_type ()) + +G_DECLARE_FINAL_TYPE (GsWorkerThread, gs_worker_thread, GS, WORKER_THREAD, GObject) + +GsWorkerThread *gs_worker_thread_new (const gchar *name); + +void gs_worker_thread_queue (GsWorkerThread *self, + gint priority, + GTaskThreadFunc work_func, + GTask *task); + +gboolean gs_worker_thread_is_in_worker_context (GsWorkerThread *self); + +void gs_worker_thread_shutdown_async (GsWorkerThread *self, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); + +gboolean gs_worker_thread_shutdown_finish (GsWorkerThread *self, + GAsyncResult *result, + GError **error); + +G_END_DECLS -- cgit v1.2.3