Fall back to non-realtime threads again

Makes Ardour start into sessions again when realtime scheduling is
unavailable.
This commit is contained in:
Matthias von Faber 2020-06-08 07:05:56 +02:00 committed by Robin Gareus
parent 4b7efac3dc
commit 662ff1bd39
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -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 */