--- a/src/Utils/Process.cpp +++ b/src/Utils/Process.cpp @@ -18,6 +18,7 @@ #include #endif +#include #include #include #include @@ -472,7 +473,7 @@ struct sched_param newSched{}; sched_getparam( 0, &newSched ); newSched.sched_priority = sched_get_priority_min( SCHED_RR ); - if ( sched_setscheduler( 0, SCHED_RR, &newSched ) ) + if ( pthread_setschedparam( pthread_self(), SCHED_RR, &newSched ) ) { s_ProcessLog.errorf_errno( "Failed to set realtime scheduling." ); return false; @@ -491,7 +492,7 @@ if ( !g_oOldSchedulerInfo ) return; - if ( sched_setscheduler( 0, g_oOldSchedulerInfo->nPolicy, &g_oOldSchedulerInfo->SchedParam ) ) + if ( pthread_setschedparam( pthread_self(), g_oOldSchedulerInfo->nPolicy, &g_oOldSchedulerInfo->SchedParam ) ) { s_ProcessLog.errorf_errno( "Failed to restore from realtime scheduling." ); return; @@ -506,4 +507,4 @@ return __progname; } -} \ No newline at end of file +}