mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Merge branch 'fallback-setattr-failure' into 'master'
GThread - Check if sched_setattr is allowed by the system policies before depending on it See merge request GNOME/glib!1356
This commit is contained in:
commit
3847bc2e0e
@ -1211,6 +1211,19 @@ g_system_thread_get_scheduler_settings (GThreadSchedulerSettings *scheduler_sett
|
||||
}
|
||||
while (res == -1);
|
||||
|
||||
/* Try setting them on the current thread to see if any system policies are
|
||||
* in place that would disallow doing so */
|
||||
res = syscall (SYS_sched_setattr, tid, scheduler_settings->attr, flags);
|
||||
if (res == -1)
|
||||
{
|
||||
int errsv = errno;
|
||||
|
||||
g_debug ("Failed to set thread scheduler attributes: %s", g_strerror (errsv));
|
||||
g_free (scheduler_settings->attr);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
#else
|
||||
return FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user