summaryrefslogtreecommitdiffstats
path: root/src/Utils.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-17 11:26:57 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-06-17 11:26:57 +0200
commite48df9cb5ec9e48cd836ec227127f42c5cc99aa1 (patch)
treefc54e01b5397c8c4017170f685e34b2270e2f880 /src/Utils.cpp
parentbab9d654f028a214e6f3abe8ade1c1da002d25ff (diff)
downloaddabmod-e48df9cb5ec9e48cd836ec227127f42c5cc99aa1.tar.gz
dabmod-e48df9cb5ec9e48cd836ec227127f42c5cc99aa1.tar.bz2
dabmod-e48df9cb5ec9e48cd836ec227127f42c5cc99aa1.zip
Set SCHED_RR prio for all data processing threads
This includes Modulator, FIR Filter and UHD worker
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r--src/Utils.cpp9
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;
+}