]> git.sesse.net Git - vlc/commitdiff
Removed vlc_thread_set_priority().
authorLaurent Aimar <fenrir@videolan.org>
Mon, 23 May 2011 18:29:52 +0000 (20:29 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 23 May 2011 19:15:54 +0000 (21:15 +0200)
src/input/input.c
src/libvlc.h
src/misc/threads.c

index 8e166824c5f0cf43dcba7c2fa42103cf05858de2..21509079ad9a4107d1d20c96b22e4c448594b2eb 100644 (file)
@@ -1292,7 +1292,7 @@ static int Init( input_thread_t * p_input )
         {
             /* We don't want a high input priority here or we'll
              * end-up sucking up all the CPU time */
-            vlc_thread_set_priority( p_input, VLC_THREAD_PRIORITY_LOW );
+            vlc_set_priority( p_input->p->thread, VLC_THREAD_PRIORITY_LOW );
         }
 
         msg_Dbg( p_input, "starting in %s mode",
index 34c44dbb251b0d083ced486ca2c7ec0695561406..75db8f0f3b59eddc3d5c60a0db89527aa74df903 100644 (file)
@@ -51,13 +51,10 @@ int vlc_clone_detach (vlc_thread_t *, void *(*)(void *), void *, int);
 /* Hopefully, no need to export this. There is a new thread API instead. */
 int vlc_thread_create( vlc_object_t *, void * ( * ) ( vlc_object_t * ), int ) VLC_USED VLC_DEPRECATED;
 void vlc_thread_join( vlc_object_t * ) VLC_DEPRECATED;
-int vlc_thread_set_priority( vlc_object_t *, int ) VLC_DEPRECATED;
 #define vlc_thread_create( P_THIS, FUNC, PRIORITY ) \
     vlc_thread_create( VLC_OBJECT(P_THIS), FUNC, PRIORITY )
 #define vlc_thread_join( P_THIS )                                           \
     vlc_thread_join( VLC_OBJECT(P_THIS) )
-#define vlc_thread_set_priority( P_THIS, PRIORITY )                         \
-    vlc_thread_set_priority( VLC_OBJECT(P_THIS), PRIORITY )
 
 void vlc_thread_cancel (vlc_object_t *);
 int vlc_object_waitpipe (vlc_object_t *obj);
index 265f60bd8bb922636cc36f47e6d34c710faf9d89..8888a017080c665f2c2551f5247b9cfbf0a0600e 100644 (file)
@@ -96,65 +96,6 @@ int vlc_thread_create( vlc_object_t *p_this, void *(*func) ( vlc_object_t * ),
     return i_ret;
 }
 
-#undef vlc_thread_set_priority
-/*****************************************************************************
- * vlc_thread_set_priority: set the priority of the current thread when we
- * couldn't set it in vlc_thread_create (for instance for the main thread)
- *****************************************************************************/
-int vlc_thread_set_priority( vlc_object_t *p_this, int i_priority )
-{
-    vlc_object_internals_t *p_priv = vlc_internals( p_this );
-
-    if( !p_priv->b_thread )
-    {
-        msg_Err( p_this, "couldn't set priority of non-existent thread" );
-        return ESRCH;
-    }
-
-#if defined( LIBVLC_USE_PTHREAD )
-# ifndef __APPLE__
-    if( var_InheritBool( p_this, "rt-priority" ) )
-# endif
-    {
-        int i_error, i_policy;
-        struct sched_param param;
-
-        memset( &param, 0, sizeof(struct sched_param) );
-        if( config_GetType( p_this, "rt-offset" ) )
-            i_priority += var_InheritInteger( p_this, "rt-offset" );
-        if( i_priority <= 0 )
-        {
-            param.sched_priority = (-1) * i_priority;
-            i_policy = SCHED_OTHER;
-        }
-        else
-        {
-            param.sched_priority = i_priority;
-            i_policy = SCHED_RR;
-        }
-        if( (i_error = pthread_setschedparam( p_priv->thread_id,
-                                              i_policy, &param )) )
-        {
-            errno = i_error;
-            msg_Warn( p_this, "cannot set thread priority (%m)" );
-            i_priority = 0;
-        }
-    }
-
-#elif defined( WIN32 ) || defined( UNDER_CE )
-
-#warning vlc_thread_set_priority() is BROKEN
-    if( true /*!SetThreadPriority(p_priv->thread_id->id, i_priority)*/ )
-    {
-        msg_Warn( p_this, "couldn't set a faster priority" );
-        return 1;
-    }
-
-#endif
-
-    return 0;
-}
-
 #undef vlc_thread_join
 /*****************************************************************************
  * vlc_thread_join: wait until a thread exits, inner version