]> git.sesse.net Git - vlc/blobdiff - src/misc/threads.c
threads: Make sure we don't re-create a thread if the object has already one.
[vlc] / src / misc / threads.c
index 2405bdb3720ab654f2cbd9c8d31823c4dca07fbf..9cac384deb65caebc5a68ef1508e18699abf5e15 100644 (file)
@@ -501,6 +501,9 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
 
     vlc_object_lock( p_this );
 
+    /* Make sure we don't re-create a thread if the object has already one */
+    assert( !p_priv->b_thread );
+
 #if defined( LIBVLC_USE_PTHREAD )
     pthread_attr_t attr;
     pthread_attr_init (&attr);
@@ -624,13 +627,8 @@ int __vlc_thread_set_priority( vlc_object_t *p_this, const char * psz_file,
 
     if( !p_priv->b_thread )
     {
-#ifndef __APPLE__
         msg_Err( p_this, "couldn't set priority of non-existent thread" );
         return ESRCH;
-#else
-# warning FIXME: this is wrong
-        p_priv->b_thread = pthread_self();
-#endif
     }
 
 #if defined( LIBVLC_USE_PTHREAD )