mirror of
https://github.com/yshui/picom.git
synced 2025-04-14 17:53:25 -04:00
utils: don't set realtime scheduling again if we already tried
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
615924cc4a
commit
dc3271e81b
1 changed files with 6 additions and 0 deletions
|
@ -282,6 +282,12 @@ void rolling_quantile_pop_front(struct rolling_quantile *rq, int x) {
|
|||
/// This requires the user to set up permissions for the real-time scheduling. e.g. by
|
||||
/// setting `ulimit -r`, or giving us the CAP_SYS_NICE capability.
|
||||
void set_rr_scheduling(void) {
|
||||
static thread_local bool already_tried = false;
|
||||
if (already_tried) {
|
||||
return;
|
||||
}
|
||||
already_tried = true;
|
||||
|
||||
int priority = sched_get_priority_min(SCHED_RR);
|
||||
|
||||
if (rtkit_make_realtime(0, priority)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue