]> git.sesse.net Git - vlc/commitdiff
Do not set a priority for non-realtime threads
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Fri, 6 Jun 2008 14:39:28 +0000 (17:39 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Fri, 6 Jun 2008 14:39:28 +0000 (17:39 +0300)
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

index db8bcb9a382c5dfbffc63211c62090d9d70b8a07..11b3d478fd476a88fed11bbe6af5e0f439918f6a 100644 (file)
@@ -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, &param);
-        }
         else
         {
             struct sched_param param = { .sched_priority = +i_priority, };