diff options
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r-- | src/Utils.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp index 4805374..ab1866c 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -114,4 +114,13 @@ void printVersion(void) } +int set_realtime_prio(int prio) +{ + // Set thread priority to realtime + const int policy = SCHED_RR; + sched_param sp; + sp.sched_priority = sched_get_priority_min(policy) + prio; + int ret = pthread_setschedparam(pthread_self(), policy, &sp); + return ret; +} |