1 /* GLIB - Library of useful routines for C programming
3 * gthreadprivate.h - GLib internal thread system related declarations.
5 * Copyright (C) 2003 Sebastian Wilhelmi
7 * SPDX-License-Identifier: LGPL-2.1-or-later
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, see <http://www.gnu.org/licenses/>.
23 #ifndef __G_THREADPRIVATE_H__
24 #define __G_THREADPRIVATE_H__
28 #include "deprecated/gthread.h"
30 typedef struct _GRealThread GRealThread;
41 /* system thread implementation (gthread-posix.c, gthread-win32.c) */
43 /* Platform-specific scheduler settings for a thread */
46 #if defined(HAVE_SYS_SCHED_GETATTR)
47 /* This is for modern Linux */
48 struct sched_attr *attr;
49 #elif defined(G_OS_WIN32)
52 /* TODO: Add support for macOS and the BSDs */
55 } GThreadSchedulerSettings;
57 void g_system_thread_wait (GRealThread *thread);
59 GRealThread *g_system_thread_new (GThreadFunc proxy,
61 const GThreadSchedulerSettings *scheduler_settings,
66 void g_system_thread_free (GRealThread *thread);
68 void g_system_thread_exit (void);
69 void g_system_thread_set_name (const gchar *name);
71 gboolean g_system_thread_get_scheduler_settings (GThreadSchedulerSettings *scheduler_settings);
74 GThread *g_thread_new_internal (const gchar *name,
79 const GThreadSchedulerSettings *scheduler_settings,
82 gboolean g_thread_get_scheduler_settings (GThreadSchedulerSettings *scheduler_settings);
84 gpointer g_thread_proxy (gpointer thread);
86 guint g_thread_n_created (void);
88 gpointer g_private_set_alloc0 (GPrivate *key,
91 #endif /* __G_THREADPRIVATE_H__ */