mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-29 07:22:17 +01:00
Add runtime checks and a fallback if we can't get the thread scheduler settings
On Linux the sched_getattr syscall might be available at compile-time but not actually work at runtime (e.g. because an older kernel is running or valgrind is used). Instead of killing the process, return FALSE and handle this gracefully at runtime with some fallback code. Fixes https://gitlab.gnome.org/GNOME/glib/issues/2007
This commit is contained in:
@@ -902,11 +902,12 @@ g_thread_new_internal (const gchar *name,
|
||||
name, func, data, error);
|
||||
}
|
||||
|
||||
void
|
||||
gboolean
|
||||
g_thread_get_scheduler_settings (GThreadSchedulerSettings *scheduler_settings)
|
||||
{
|
||||
g_return_if_fail (scheduler_settings != NULL);
|
||||
g_system_thread_get_scheduler_settings (scheduler_settings);
|
||||
g_return_val_if_fail (scheduler_settings != NULL, FALSE);
|
||||
|
||||
return g_system_thread_get_scheduler_settings (scheduler_settings);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user