]> git.sesse.net Git - vlc/commitdiff
Remove vlc_thread_create
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 14 Jan 2009 19:21:49 +0000 (21:21 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 14 Jan 2009 19:21:49 +0000 (21:21 +0200)
By the way, its earlier (<= 0.8.6) incarnation were buggy.

include/vlc_threads.h
src/libvlc.h
src/libvlccore.sym
src/misc/threads.c

index 0232dc78df8be09163085436dddbbeb98fedd6a8..fb9bb54e8009c3b93898e38028bfd2ba193b0627 100644 (file)
@@ -172,9 +172,6 @@ enum {
 };
 #endif
 
-VLC_EXPORT(void, vlc_thread_ready, (vlc_object_t *obj));
-#define vlc_thread_ready(o) vlc_thread_ready(VLC_OBJECT(o))
-
 /**
  * Save the cancellation state and disable cancellation for the calling thread.
  * This function must be called before entering a piece of code that is not
index 35801b82f30a90805649d9678bce89666589f59a..b4c5b9a053f1108c77535ae68d586f031d1c895f 100644 (file)
@@ -141,10 +141,6 @@ extern char *psz_vlcpath;
 VLC_EXPORT(char **, module_GetModulesNamesForCapability,
                     ( const char * psz_capability, char ***psz_longname ) );
 
-#ifdef LIBVLC_USE_PTHREAD
-# include <semaphore.h> /* TODO: get rid of vlc_thread_ready and this */
-#endif
-
 /**
  * Private LibVLC data for each object.
  */
@@ -159,11 +155,6 @@ typedef struct vlc_object_internals_t
     /* Thread properties, if any */
     vlc_thread_t    thread_id;
     bool            b_thread;
-#ifdef LIBVLC_USE_PTHREAD
-    sem_t           thread_ready;
-#elif defined (WIN32)
-    HANDLE          thread_ready;
-#endif
 
     /* Objects thread synchronization */
     vlc_mutex_t     lock;
index e5bb2cf35903fe2338efb07f5a48c9043b9d514f..ab96c326451b7dd87dc579296681dff68f21856a 100644 (file)
@@ -506,7 +506,6 @@ vlc_strtoll
 vlc_submodule_create
 __vlc_thread_create
 __vlc_thread_join
-vlc_thread_ready
 __vlc_thread_set_priority
 vlc_threadvar_create
 vlc_threadvar_delete
index 4d618d49d11214e928f4e9db0e212638cf8d0ea0..53d59f7ba68c1449462845efc1773526db6fcef5 100644 (file)
@@ -868,8 +868,6 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
     assert( !p_priv->b_thread );
 
 #if defined( LIBVLC_USE_PTHREAD )
-    if (b_wait)
-        sem_init (&p_priv->thread_ready, 0, 0);
 #ifndef __APPLE__
     if( config_GetInt( p_this, "rt-priority" ) > 0 )
 #endif
@@ -878,9 +876,6 @@ 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" );
     }
-#elif defined (WIN32)
-    if (b_wait)
-        p_priv->thread_ready = CreateEvent (NULL, TRUE, FALSE, NULL);
 #endif
 
     p_priv->b_thread = true;
@@ -889,17 +884,7 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
     {
         msg_Dbg( p_this, "thread (%s) created at priority %d (%s:%d)",
                  psz_name, i_priority, psz_file, i_line );
-        if( b_wait )
-        {
-            msg_Dbg( p_this, "waiting for thread initialization" );
-#if defined (LIBVLC_USE_PTHREAD)
-            sem_wait (&p_priv->thread_ready);
-            sem_destroy (&p_priv->thread_ready);
-#elif defined (WIN32)
-            WaitForSingleObject (p_priv->thread_ready, INFINITE);
-            CloseHandle (p_priv->thread_ready);
-#endif
-        }
+        assert( !b_wait );
     }
     else
     {
@@ -912,20 +897,6 @@ int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line
     return i_ret;
 }
 
-#undef vlc_thread_ready
-void vlc_thread_ready (vlc_object_t *obj)
-{
-    vlc_object_internals_t *priv = vlc_internals (obj);
-
-    assert (priv->b_thread);
-#if defined (LIBVLC_USE_PTHREAD)
-    assert (pthread_equal (pthread_self (), priv->thread_id));
-    sem_post (&priv->thread_ready);
-#elif defined (WIN32)
-    SetEvent (priv->thread_ready);
-#endif
-}
-
 /*****************************************************************************
  * 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)