_run = true;
_port_change_flag = false;
- if (_realtime_pthread_create (SCHED_FIFO, -20,
+ if (_realtime_pthread_create (SCHED_FIFO, -20, 100000,
&_main_thread, pthread_process, this))
{
if (pthread_create (&_main_thread, NULL, pthread_process, this))
pthread_attr_t attr;
size_t stacksize = 100000;
- pthread_attr_init (&attr);
- pthread_attr_setstacksize (&attr, stacksize);
ThreadData* td = new ThreadData (this, func, stacksize);
- if (pthread_create (&thread_id, &attr, alsa_process_thread, td)) {
- PBD::error << _("AudioEngine: cannot create process thread.") << endmsg;
+ if (_realtime_pthread_create (SCHED_FIFO, -21, stacksize,
+ &thread_id, alsa_process_thread, td)) {
+ pthread_attr_init (&attr);
+ pthread_attr_setstacksize (&attr, stacksize);
+ if (pthread_create (&thread_id, &attr, alsa_process_thread, td)) {
+ PBD::error << _("AudioEngine: cannot create process thread.") << endmsg;
+ pthread_attr_destroy (&attr);
+ return -1;
+ }
pthread_attr_destroy (&attr);
- return -1;
}
- pthread_attr_destroy (&attr);
_threads.push_back (thread_id);
return 0;
int
AlsaRawMidiIO::start ()
{
- if (_realtime_pthread_create (SCHED_FIFO, -19,
+ if (_realtime_pthread_create (SCHED_FIFO, -21, 100000,
&_main_thread, pthread_process, this))
{
if (pthread_create (&_main_thread, NULL, pthread_process, this)) {
static int
_realtime_pthread_create (
- int policy, int priority,
+ const int policy, int priority, const size_t stacksize,
pthread_t *thread,
void *(*start_routine) (void *),
void *arg)
pthread_attr_t attr;
struct sched_param parm;
- const size_t stacksize = 100000;
const int p_min = sched_get_priority_min (policy);
const int p_max = sched_get_priority_max (policy);