Renamed to glib/gthreadprivate.h and moved system thread identifier
2006-05-09 Sebastian Wilhelmi <wilhelmi@google.com>
* glib/gthreadinit.h: Renamed to glib/gthreadprivate.h and moved
system thread identifier comparision and assignment macros from
glib/gthread.c to glib/gthreadprivate.h.
* glib/Makefile.am, glib/gatomic.c, glib/gconvert.c, glib/gmain.c,
glib/gmem.c, glib/gmessages.c, glib/grand.c, glib/gslice.c,
glib/gthread.c, glib/gutils.c, gthread/gthread-impl.c: Use
glib/gthreadprivate.h instead of glib/gthreadinit.h.
* gthread/gthread-impl.c: Use GSystemThread instead of GThread for
owner determination. This fixes #311043 and is mostly modeled
after the patch from jylefort@FreeBSD.org.
2006-05-10 00:44:50 +00:00
|
|
|
/* GLIB - Library of useful routines for C programming
|
|
|
|
*
|
|
|
|
* gthreadprivate.h - GLib internal thread system related declarations.
|
2003-02-14 15:08:46 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2003 Sebastian Wilhelmi
|
|
|
|
*
|
2016-12-27 17:40:22 +01:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2017-01-05 12:47:07 +01:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2003-02-14 15:08:46 +00:00
|
|
|
*
|
2016-12-27 17:40:22 +01:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2003-02-14 15:08:46 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
2016-12-27 17:40:22 +01:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2003-02-14 15:08:46 +00:00
|
|
|
*/
|
|
|
|
|
Renamed to glib/gthreadprivate.h and moved system thread identifier
2006-05-09 Sebastian Wilhelmi <wilhelmi@google.com>
* glib/gthreadinit.h: Renamed to glib/gthreadprivate.h and moved
system thread identifier comparision and assignment macros from
glib/gthread.c to glib/gthreadprivate.h.
* glib/Makefile.am, glib/gatomic.c, glib/gconvert.c, glib/gmain.c,
glib/gmem.c, glib/gmessages.c, glib/grand.c, glib/gslice.c,
glib/gthread.c, glib/gutils.c, gthread/gthread-impl.c: Use
glib/gthreadprivate.h instead of glib/gthreadinit.h.
* gthread/gthread-impl.c: Use GSystemThread instead of GThread for
owner determination. This fixes #311043 and is mostly modeled
after the patch from jylefort@FreeBSD.org.
2006-05-10 00:44:50 +00:00
|
|
|
#ifndef __G_THREADPRIVATE_H__
|
|
|
|
#define __G_THREADPRIVATE_H__
|
2003-02-14 15:08:46 +00:00
|
|
|
|
2020-01-16 16:02:39 +02:00
|
|
|
#include "config.h"
|
|
|
|
|
2011-10-02 01:29:08 -04:00
|
|
|
#include "deprecated/gthread.h"
|
2003-02-14 15:08:46 +00:00
|
|
|
|
2011-10-12 16:50:43 -04:00
|
|
|
typedef struct _GRealThread GRealThread;
|
2011-10-13 01:22:51 -04:00
|
|
|
struct _GRealThread
|
|
|
|
{
|
|
|
|
GThread thread;
|
2011-10-12 16:50:43 -04:00
|
|
|
|
2011-10-13 01:22:51 -04:00
|
|
|
gint ref_count;
|
|
|
|
gboolean ours;
|
2011-11-14 22:18:13 -05:00
|
|
|
gchar *name;
|
2011-10-13 01:22:51 -04:00
|
|
|
gpointer retval;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* system thread implementation (gthread-posix.c, gthread-win32.c) */
|
2019-12-24 15:33:30 +02:00
|
|
|
|
|
|
|
/* Platform-specific scheduler settings for a thread */
|
2020-01-20 14:39:52 +00:00
|
|
|
typedef struct
|
2019-12-24 15:33:30 +02:00
|
|
|
{
|
2020-01-20 14:39:52 +00:00
|
|
|
#if defined(HAVE_SYS_SCHED_GETATTR)
|
|
|
|
/* This is for modern Linux */
|
2019-12-24 15:33:30 +02:00
|
|
|
struct sched_attr *attr;
|
|
|
|
#elif defined(G_OS_WIN32)
|
|
|
|
gint thread_prio;
|
2020-01-20 14:39:52 +00:00
|
|
|
#else
|
|
|
|
/* TODO: Add support for macOS and the BSDs */
|
|
|
|
void *dummy;
|
2019-12-24 15:33:30 +02:00
|
|
|
#endif
|
2020-01-20 14:39:52 +00:00
|
|
|
} GThreadSchedulerSettings;
|
2019-12-24 15:33:30 +02:00
|
|
|
|
2011-10-12 22:29:13 -04:00
|
|
|
void g_system_thread_wait (GRealThread *thread);
|
2011-10-12 22:03:14 -04:00
|
|
|
|
2019-12-24 15:33:30 +02:00
|
|
|
GRealThread *g_system_thread_new (GThreadFunc proxy,
|
|
|
|
gulong stack_size,
|
|
|
|
const GThreadSchedulerSettings *scheduler_settings,
|
|
|
|
const char *name,
|
|
|
|
GThreadFunc func,
|
|
|
|
gpointer data,
|
|
|
|
GError **error);
|
2011-10-12 22:03:14 -04:00
|
|
|
void g_system_thread_free (GRealThread *thread);
|
Renamed to glib/gthreadprivate.h and moved system thread identifier
2006-05-09 Sebastian Wilhelmi <wilhelmi@google.com>
* glib/gthreadinit.h: Renamed to glib/gthreadprivate.h and moved
system thread identifier comparision and assignment macros from
glib/gthread.c to glib/gthreadprivate.h.
* glib/Makefile.am, glib/gatomic.c, glib/gconvert.c, glib/gmain.c,
glib/gmem.c, glib/gmessages.c, glib/grand.c, glib/gslice.c,
glib/gthread.c, glib/gutils.c, gthread/gthread-impl.c: Use
glib/gthreadprivate.h instead of glib/gthreadinit.h.
* gthread/gthread-impl.c: Use GSystemThread instead of GThread for
owner determination. This fixes #311043 and is mostly modeled
after the patch from jylefort@FreeBSD.org.
2006-05-10 00:44:50 +00:00
|
|
|
|
2011-10-13 01:22:51 -04:00
|
|
|
void g_system_thread_exit (void);
|
|
|
|
void g_system_thread_set_name (const gchar *name);
|
|
|
|
|
2020-01-18 13:23:30 +02:00
|
|
|
gboolean g_system_thread_get_scheduler_settings (GThreadSchedulerSettings *scheduler_settings);
|
2011-09-18 23:18:17 -04:00
|
|
|
|
2011-10-13 01:22:51 -04:00
|
|
|
/* gthread.c */
|
2019-12-24 15:33:30 +02:00
|
|
|
GThread *g_thread_new_internal (const gchar *name,
|
|
|
|
GThreadFunc proxy,
|
|
|
|
GThreadFunc func,
|
|
|
|
gpointer data,
|
|
|
|
gsize stack_size,
|
|
|
|
const GThreadSchedulerSettings *scheduler_settings,
|
|
|
|
GError **error);
|
|
|
|
|
2020-01-18 13:23:30 +02:00
|
|
|
gboolean g_thread_get_scheduler_settings (GThreadSchedulerSettings *scheduler_settings);
|
2011-10-02 09:51:13 -04:00
|
|
|
|
2011-10-13 01:22:51 -04:00
|
|
|
gpointer g_thread_proxy (gpointer thread);
|
Renamed to glib/gthreadprivate.h and moved system thread identifier
2006-05-09 Sebastian Wilhelmi <wilhelmi@google.com>
* glib/gthreadinit.h: Renamed to glib/gthreadprivate.h and moved
system thread identifier comparision and assignment macros from
glib/gthread.c to glib/gthreadprivate.h.
* glib/Makefile.am, glib/gatomic.c, glib/gconvert.c, glib/gmain.c,
glib/gmem.c, glib/gmessages.c, glib/grand.c, glib/gslice.c,
glib/gthread.c, glib/gutils.c, gthread/gthread-impl.c: Use
glib/gthreadprivate.h instead of glib/gthreadinit.h.
* gthread/gthread-impl.c: Use GSystemThread instead of GThread for
owner determination. This fixes #311043 and is mostly modeled
after the patch from jylefort@FreeBSD.org.
2006-05-10 00:44:50 +00:00
|
|
|
|
2019-07-25 15:08:29 +01:00
|
|
|
guint g_thread_n_created (void);
|
|
|
|
|
2018-12-06 15:16:33 +00:00
|
|
|
gpointer g_private_set_alloc0 (GPrivate *key,
|
|
|
|
gsize size);
|
|
|
|
|
Renamed to glib/gthreadprivate.h and moved system thread identifier
2006-05-09 Sebastian Wilhelmi <wilhelmi@google.com>
* glib/gthreadinit.h: Renamed to glib/gthreadprivate.h and moved
system thread identifier comparision and assignment macros from
glib/gthread.c to glib/gthreadprivate.h.
* glib/Makefile.am, glib/gatomic.c, glib/gconvert.c, glib/gmain.c,
glib/gmem.c, glib/gmessages.c, glib/grand.c, glib/gslice.c,
glib/gthread.c, glib/gutils.c, gthread/gthread-impl.c: Use
glib/gthreadprivate.h instead of glib/gthreadinit.h.
* gthread/gthread-impl.c: Use GSystemThread instead of GThread for
owner determination. This fixes #311043 and is mostly modeled
after the patch from jylefort@FreeBSD.org.
2006-05-10 00:44:50 +00:00
|
|
|
#endif /* __G_THREADPRIVATE_H__ */
|