File indexing completed on 2024-11-10 04:57:22
0001 /* 0002 SPDX-FileCopyrightText: 2022 Vlad Zahorodnii <vlad.zahorodnii@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "realtime.h" 0008 0009 #include "config-kwin.h" 0010 0011 #include <sched.h> 0012 0013 namespace KWin 0014 { 0015 0016 void gainRealTime() 0017 { 0018 #if HAVE_SCHED_RESET_ON_FORK 0019 const int minPriority = sched_get_priority_min(SCHED_RR); 0020 sched_param sp; 0021 sp.sched_priority = minPriority; 0022 sched_setscheduler(0, SCHED_RR | SCHED_RESET_ON_FORK, &sp); 0023 #endif 0024 } 0025 0026 } // namespace KWin