static void consumer_read_ahead_start( mlt_consumer this )
{
+ pthread_attr_t thread_attributes;
+
// We're running now
this->ahead = 1;
// Create the condition
pthread_cond_init( &this->cond, NULL );
+ // Inherit the scheduling priority
+ pthread_attr_init( &thread_attributes );
+ pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
+
// Create the read ahead
- pthread_create( &this->ahead_thread, NULL, consumer_read_ahead_thread, this );
+ pthread_create( &this->ahead_thread, &thread_attributes, consumer_read_ahead_thread, this );
}
{
// Allocate a thread
pthread_t *thread = calloc( 1, sizeof( pthread_t ) );
+ pthread_attr_t thread_attributes;
// Get the width and height
int width = mlt_properties_get_int( properties, "width" );
// Set the running state
mlt_properties_set_int( properties, "running", 1 );
+ // Inherit the scheduling priority
+ pthread_attr_init( &thread_attributes );
+ pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
+
// Create the thread
- pthread_create( thread, NULL, consumer_thread, this );
+ pthread_create( thread, &thread_attributes, consumer_thread, this );
}
return 0;
}
// Free the memory
free( this );
}
-
{
// Allocate a thread
pthread_t *thread = calloc( 1, sizeof( pthread_t ) );
+ pthread_attr_t thread_attributes;
// Assign the thread to properties
mlt_properties_set_data( properties, "thread", thread, sizeof( pthread_t ), free, NULL );
// Set the running state
mlt_properties_set_int( properties, "running", 1 );
+ // Inherit the scheduling priority
+ pthread_attr_init( &thread_attributes );
+ pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
+
// Create the thread
- pthread_create( thread, NULL, consumer_thread, this );
+ pthread_create( thread, &thread_attributes, consumer_thread, this );
}
return 0;
}
// Free the memory
free( this );
}
-
if ( !this->running )
{
+ pthread_attr_t thread_attributes;
+
this->running = 1;
- pthread_create( &this->thread, NULL, consumer_thread, this );
+
+ // Inherit the scheduling priority
+ pthread_attr_init( &thread_attributes );
+ pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED );
+
+ pthread_create( &this->thread, &thread_attributes, consumer_thread, this );
}
return 0;