[glib/wip/pwithnall/thread-settings-fixes] gthread: Ensure GThreadSchedulerSettings is always defined
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/pwithnall/thread-settings-fixes] gthread: Ensure GThreadSchedulerSettings is always defined
- Date: Mon, 20 Jan 2020 14:41:02 +0000 (UTC)
commit 30c8eb85ab90df3c639bd37f37a688542f35de66
Author: Philip Withnall <withnall endlessm com>
Date: Mon Jan 20 14:39:52 2020 +0000
gthread: Ensure GThreadSchedulerSettings is always defined
It’s now used unconditionally for `shared_thread_scheduler_settings` in
`gthreadpool.c`, so it actually needs to have a storage definition.
Fixes a build failure on FreeBSD.
Signed-off-by: Philip Withnall <withnall endlessm com>
glib/gthreadprivate.h | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
---
diff --git a/glib/gthreadprivate.h b/glib/gthreadprivate.h
index afbe75934..888b3766d 100644
--- a/glib/gthreadprivate.h
+++ b/glib/gthreadprivate.h
@@ -39,26 +39,18 @@ struct _GRealThread
/* system thread implementation (gthread-posix.c, gthread-win32.c) */
/* Platform-specific scheduler settings for a thread */
-typedef struct _GThreadSchedulerSettings GThreadSchedulerSettings;
-
-/* TODO: Add the same for macOS and the BSDs */
-#if defined(HAVE_SYS_SCHED_GETATTR)
-/* This is for modern Linux */
-struct _GThreadSchedulerSettings
+typedef struct
{
+#if defined(HAVE_SYS_SCHED_GETATTR)
+ /* This is for modern Linux */
struct sched_attr *attr;
-};
-
-#define HAVE_GTHREAD_SCHEDULER_SETTINGS 1
-
#elif defined(G_OS_WIN32)
-struct _GThreadSchedulerSettings
-{
gint thread_prio;
-};
-
-#define HAVE_GTHREAD_SCHEDULER_SETTINGS 1
+#else
+ /* TODO: Add support for macOS and the BSDs */
+ void *dummy;
#endif
+} GThreadSchedulerSettings;
void g_system_thread_wait (GRealThread *thread);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]