[vlc-devel] commit: Do not set a priority for non-realtime threads ( Rémi Denis-Courmont )
git version control
git at videolan.org
Fri Jun 6 16:37:44 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Fri Jun 6 17:39:28 2008 +0300| [33c8a14f95a2c378b1f374ff3e2d3e669d4992a3]
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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=33c8a14f95a2c378b1f374ff3e2d3e669d4992a3
---
src/misc/threads.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/src/misc/threads.c b/src/misc/threads.c
index db8bcb9..11b3d47 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, };
More information about the vlc-devel
mailing list