Commit db059f56 authored by Simon Morlat's avatar Simon Morlat
Browse files

allow MSTicker to run with sched_rr whenever permitted

parent c3ced7f7
......@@ -276,16 +276,17 @@ static int set_high_prio(void){
struct sched_param param;
int policy=SCHED_RR;
int policy=SCHED_OTHER;
if((result=pthread_setschedparam(pthread_self(),policy, &param))) {
ms_warning("Set sched param failed with error code(%i)\n",result);
if((result=pthread_setschedparam(pthread_self(),SCHED_RR, &param))) {
if (result==EPERM){
if((result=pthread_setschedparam(pthread_self(),SCHED_OTHER, &param))) {
ms_warning("Set pthread_setschedparam failed: %s",strerror(result));
}else ms_message("MS ticker priority set to SCHED_OTHER and max (%i)",param.sched_priority);
}else ms_warning("Set pthread_setschedparam failed: %s",strerror(result));
} else {
ms_message("MS ticker priority set to max (%i)",param.sched_priority);
ms_message("MS ticker priority set to SCHED_RR and max (%i)",param.sched_priority);
return precision;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment