From 33c8a14f95a2c378b1f374ff3e2d3e669d4992a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Fri, 6 Jun 2008 17:39:28 +0300 Subject: [PATCH] Do not set a priority for non-realtime threads Contrary to process priority increment ("niceness"), thread priority increment increase in the priority of the thread. So multiplying negative priorities with -1 was totally wrong here. On Linux, there is only one non-realtime (SCHED_OTHER) priority, 0, so the code was failing safe silently. Don't know on other systems. --- src/misc/threads.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/misc/threads.c b/src/misc/threads.c index db8bcb9a38..11b3d478fd 100644 --- a/src/misc/threads.c +++ b/src/misc/threads.c @@ -517,11 +517,7 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line if( config_GetType( p_this, "rt-offset" ) ) i_priority += config_GetInt( p_this, "rt-offset" ); if( i_priority <= 0 ) - { - struct sched_param param = { .sched_priority = -i_priority, }; pthread_attr_setschedpolicy (&attr, SCHED_OTHER); - pthread_attr_setschedparam (&attr, ¶m); - } else { struct sched_param param = { .sched_priority = +i_priority, }; -- 2.39.2