From d80de6c81ab37e1b3bc7abe91946f5ebcaa95515 Mon Sep 17 00:00:00 2001 From: James Thomas Date: Mon, 16 Jul 2018 11:13:38 +0100 Subject: [PATCH] Use PTHREAD_EXPLICIT_SCHED for non RT threads This prevents jack control threads from inheriting RT priorities from other applications that may be using this in another RT thread --- posix/JackPosixThread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/posix/JackPosixThread.cpp b/posix/JackPosixThread.cpp index e11358cb..44205a9e 100644 --- a/posix/JackPosixThread.cpp +++ b/posix/JackPosixThread.cpp @@ -134,6 +134,9 @@ int JackPosixThread::StartImp(jack_native_thread_t* thread, int priority, int re } else { jack_log("JackPosixThread::StartImp : create non RT thread"); + if ((res = pthread_attr_setinheritsched(&attributes, PTHREAD_EXPLICIT_SCHED))) { + jack_log("Cannot request explicit scheduling for non RT thread res = %d", res); + } } if ((res = pthread_attr_setstacksize(&attributes, THREAD_STACK))) {