module-rt: fix formating and comment

This commit is contained in:
Wim Taymans 2022-04-24 10:18:47 +02:00
parent b95c145446
commit d9fd4dc76a

View file

@ -536,15 +536,14 @@ static bool check_realtime_privileges(rlim_t priority)
} }
/* If the current scheduling policy has `SCHED_RESET_ON_FORK` set, then /* If the current scheduling policy has `SCHED_RESET_ON_FORK` set, then
* this also needs to be set here or `sched_setscheduler()` will return * this also needs to be set here or `pthread_setschedparam()` will return
* an error code. Similarly, if it is not set, then we don't want to set * an error code. Similarly, if it is not set, then we don't want to set
* it here as it would irreversible change the current thread's * it here as it would irreversible change the current thread's
* scheduling policy. */ * scheduling policy. */
spa_zero(new_sched_params); spa_zero(new_sched_params);
new_sched_params.sched_priority = priority; new_sched_params.sched_priority = priority;
if ((old_policy & PW_SCHED_RESET_ON_FORK) != 0) { if ((old_policy & PW_SCHED_RESET_ON_FORK) != 0)
new_policy |= PW_SCHED_RESET_ON_FORK; new_policy |= PW_SCHED_RESET_ON_FORK;
}
if (pthread_setschedparam(pthread_self(), new_policy, &new_sched_params) == 0) { if (pthread_setschedparam(pthread_self(), new_policy, &new_sched_params) == 0) {
pthread_setschedparam(pthread_self(), old_policy, &old_sched_params); pthread_setschedparam(pthread_self(), old_policy, &old_sched_params);