}
}
+static inline void PTHREAD_SET_PRIORITY(const pthread_t thread, const int priority)
+{
+ struct sched_param params;
+ params.sched_priority = priority;
+ if (pthread_setschedparam(thread, SCHED_OTHER, ¶ms))
+ {
+ crit_exit("FATAL: PThread internal error!");
+ }
+}
+
static inline void MUTEX_INIT(pthread_mutex_t *const mtx)
{
if (pthread_mutex_init(mtx, NULL))
thread_data[t].mutex = &stop_mutex;
thread_data[t].rand = &thread_rand[t];
PTHREAD_CREATE(&thread_id[t], NULL, thread_main, &thread_data[t]);
+ PTHREAD_SET_PRIORITY(thread_id[t], -2);
}
for (size_t t = 0; t < THREAD_COUNT; t++)