1
0
Fork 0
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:
Yuxuan Shui 2024-03-03 01:28:35 +00:00
parent 615924cc4a
commit dc3271e81b
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4

View file

@ -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)) {