From 4734af747b3f7c4560cbf7757f4d857445382f01 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 14 Jan 2014 09:59:04 +0100 Subject: OutputThread: use real-time priority --- src/thread/Util.hxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/thread') diff --git a/src/thread/Util.hxx b/src/thread/Util.hxx index fe36468c3..c09fef532 100644 --- a/src/thread/Util.hxx +++ b/src/thread/Util.hxx @@ -69,4 +69,17 @@ SetThreadIdlePriority() #endif }; +/** + * Raise the current thread's priority to "real-time" (very high). + */ +static inline void +SetThreadRealtime() +{ +#ifdef __linux__ + struct sched_param sched_param; + sched_param.sched_priority = 50; + sched_setscheduler(0, SCHED_FIFO, &sched_param); +#endif +}; + #endif -- cgit v1.2.3