From 1d921dec0bc137fe96ece1fde90941e99c79a070 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 28 Sep 2024 14:47:52 +0200 Subject: [PATCH] Debug thread sched_priority --- libs/pbd/pthread_utils.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc index f798da4d8a..41a3e63a17 100644 --- a/libs/pbd/pthread_utils.cc +++ b/libs/pbd/pthread_utils.cc @@ -369,7 +369,7 @@ pbd_realtime_pthread_create ( if (stacksize > 0) { pthread_attr_setstacksize (&attr, stacksize + pbd_stack_size ()); } - DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Start Realtime Thread policy = %1 priority = %2 stacksize = 0x%3%4\n", policy, priority, std::hex, stacksize)); + DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Start Realtime Thread policy = %1 priority = %2 stacksize = 0x%3%4\n", policy, parm.sched_priority, std::hex, stacksize)); rv = pthread_create (thread, &attr, start_routine, arg); pthread_attr_destroy (&attr); return rv; @@ -382,6 +382,8 @@ pbd_set_thread_priority (pthread_t thread, const int policy, int priority) memset (¶m, 0, sizeof (param)); param.sched_priority = pbd_absolute_rt_priority (policy, priority); + DEBUG_TRACE (PBD::DEBUG::Threads, string_compose ("Change '%1' to policy = %2 priority = %3\n", pthread_name(), policy, param.sched_priority)); + return pthread_setschedparam (thread, SCHED_FIFO, ¶m); }