From 662ff1bd39c07104b0795cd1490c113aa4df7a08 Mon Sep 17 00:00:00 2001 From: Matthias von Faber Date: Mon, 8 Jun 2020 07:05:56 +0200 Subject: [PATCH] Fall back to non-realtime threads again Makes Ardour start into sessions again when realtime scheduling is unavailable. --- libs/ardour/rt_tasklist.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/ardour/rt_tasklist.cc b/libs/ardour/rt_tasklist.cc index e0d6c475f3..b9cad49522 100644 --- a/libs/ardour/rt_tasklist.cc +++ b/libs/ardour/rt_tasklist.cc @@ -85,11 +85,13 @@ RTTaskList::reset_thread_list () g_atomic_int_set (&_threads_active, 1); for (uint32_t i = 0; i < num_threads; ++i) { pthread_t thread_id; - int rv = AudioEngine::instance()->is_realtime () ? - pbd_realtime_pthread_create (PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority(), PBD_RT_STACKSIZE_HELP, &thread_id, _thread_run, this) - : - pbd_pthread_create (PBD_RT_STACKSIZE_HELP, &thread_id, _thread_run, this); - + int rv = 1; + if (AudioEngine::instance()->is_realtime ()) { + rv = pbd_realtime_pthread_create (PBD_SCHED_FIFO, AudioEngine::instance()->client_real_time_priority(), PBD_RT_STACKSIZE_HELP, &thread_id, _thread_run, this); + } + if (rv) { + rv = pbd_pthread_create (PBD_RT_STACKSIZE_HELP, &thread_id, _thread_run, this); + } if (rv) { PBD::fatal << _("Cannot create thread for TaskList! (") << strerror(rv) << ')' << endmsg; /* NOT REACHED */