]> git.sesse.net Git - vlc/blobdiff - src/misc/threads.c
vlc_(d|l|m)rand48: thread-safe wrappers for non-secure/fast PRNG
[vlc] / src / misc / threads.c
index 7b68ce72c467e89bb03096ea95f33b1fd147bbf8..5099041ef18d7948b558ffdeddfb94d6cadc73f6 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "libvlc.h"
 #include <assert.h>
+#include <errno.h>
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
@@ -99,12 +100,13 @@ int vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line,
     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, const char * psz_file,
-                               int i_line, int i_priority )
+int vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
+                             int i_line, int i_priority )
 {
     vlc_object_internals_t *p_priv = vlc_internals( p_this );
 
@@ -116,7 +118,7 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
 
 #if defined( LIBVLC_USE_PTHREAD )
 # ifndef __APPLE__
-    if( config_GetInt( p_this, "rt-priority" ) > 0 )
+    if( var_InheritBool( p_this, "rt-priority" ) )
 # endif
     {
         int i_error, i_policy;
@@ -124,7 +126,7 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
 
         memset( &param, 0, sizeof(struct sched_param) );
         if( config_GetType( p_this, "rt-offset" ) )
-            i_priority += config_GetInt( p_this, "rt-offset" );
+            i_priority += var_InheritInteger( p_this, "rt-offset" );
         if( i_priority <= 0 )
         {
             param.sched_priority = (-1) * i_priority;
@@ -163,10 +165,11 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
     return 0;
 }
 
+#undef vlc_thread_join
 /*****************************************************************************
  * vlc_thread_join: wait until a thread exits, inner version
  *****************************************************************************/
-void __vlc_thread_join( vlc_object_t *p_this )
+void vlc_thread_join( vlc_object_t *p_this )
 {
     vlc_object_internals_t *p_priv = vlc_internals( p_this );