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>
This commit is contained in:
Philip Withnall 2020-01-20 14:39:52 +00:00
parent fda1c651d5
commit 30c8eb85ab

View File

@ -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 */
typedef struct
{
#if defined(HAVE_SYS_SCHED_GETATTR)
/* This is for modern Linux */
struct _GThreadSchedulerSettings
{
/* 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);