TT#49350 eliminate stray scheduling warning

Change-Id: I84a13cdca6bf85de8d3fd8b086de6f57287b7b15
(cherry picked from commit aaf8cbd525)
changes/03/25903/1
Richard Fuchs 7 years ago
parent ccf4790df6
commit 858786eec2

@ -186,12 +186,15 @@ static void *thread_detach_func(void *d) {
if (!scheduler)
ilog(LOG_ERR, "Specified scheduler policy '%s' not found", dt->scheduler);
else {
else if (scheduler->num != -1) {
struct sched_param param = { 0 };
if (!scheduler->nice)
param.sched_priority = dt->priority;
ilog(LOG_DEBUG, "Setting thread scheduling parameters to '%s' (%i) / %i",
dt->scheduler, scheduler->num, param.sched_priority);
if (pthread_setschedparam(*t, scheduler->num, &param))
ilog(LOG_ERR, "Failed to set thread scheduling parameters to '%s' (%i) / %i: %s",
dt->scheduler, scheduler->num, param.sched_priority,
@ -201,9 +204,11 @@ static void *thread_detach_func(void *d) {
}
if ((!scheduler && dt->priority) || (scheduler && scheduler->nice)) {
ilog(LOG_DEBUG, "Setting thread nice value to %i", dt->priority);
if (setpriority(PRIO_PROCESS, 0, dt->priority))
ilog(LOG_ERR, "Failed to set thread nice value: %s",
strerror(errno));
ilog(LOG_ERR, "Failed to set thread nice value to %i: %s",
dt->priority, strerror(errno));
}
dt->func(dt->data);

Loading…
Cancel
Save