Commit 0984b220 authored by Laurent Aimar's avatar Laurent Aimar

Removed vlc_thread_set_priority().

parent 2f994865
......@@ -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",
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment