X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Fthreads.c;h=90c6029ef545aeb5f87c85ab11eca36f4ac218ee;hb=aa47b1621816c96eff4d6c7edb7b4859192013a4;hp=11b3d478fd476a88fed11bbe6af5e0f439918f6a;hpb=33c8a14f95a2c378b1f374ff3e2d3e669d4992a3;p=vlc diff --git a/src/misc/threads.c b/src/misc/threads.c index 11b3d478fd..90c6029ef5 100644 --- a/src/misc/threads.c +++ b/src/misc/threads.c @@ -48,6 +48,8 @@ static volatile unsigned i_initializations = 0; #if defined( LIBVLC_USE_PTHREAD ) +# include + static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER; #endif @@ -520,8 +522,10 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line pthread_attr_setschedpolicy (&attr, SCHED_OTHER); else { - struct sched_param param = { .sched_priority = +i_priority, }; - pthread_attr_setschedpolicy (&attr, SCHED_OTHER); + struct sched_param param = { .sched_priority = i_priority, }; + + param.sched_priority += sched_get_priority_min (SCHED_RR); + pthread_attr_setschedpolicy (&attr, SCHED_RR); pthread_attr_setschedparam (&attr, ¶m); } }