[vlc-commits] Remove useless MonitorLibVLCDeath() contorsion

Rémi Denis-Courmont git at videolan.org
Mon May 7 18:58:19 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon May  7 19:26:55 2012 +0300| [93143da0c66bc3bbc9058701bd81a05999077181] | committer: Rémi Denis-Courmont

Remove useless MonitorLibVLCDeath() contorsion

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93143da0c66bc3bbc9058701bd81a05999077181
---

 src/interface/interface.c |   33 +--------------------------------
 1 files changed, 1 insertions(+), 32 deletions(-)

diff --git a/src/interface/interface.c b/src/interface/interface.c
index 11068ce..b3a7c48 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -134,19 +134,9 @@ int intf_Create( vlc_object_t *p_this, const char *chain )
      * (it needs access to the main thread) */
     if( p_intf->b_should_run_on_first_thread )
     {
-        if( vlc_clone( &p_intf->thread,
-                       MonitorLibVLCDeath, p_intf, VLC_THREAD_PRIORITY_LOW ) )
-        {
-            msg_Err( p_intf, "cannot spawn libvlc death monitoring thread" );
-            goto error;
-        }
+        libvlc_SetExitHandler( p_libvlc, vlc_object_kill, p_intf );
         assert( p_intf->pf_run );
         p_intf->pf_run( p_intf );
-
-        /* It is monitoring libvlc, not the p_intf */
-        vlc_object_kill( p_intf->p_libvlc );
-
-        vlc_join( p_intf->thread, NULL );
     }
     else
 #endif
@@ -230,27 +220,6 @@ static void* RunInterface( void *p_this )
     return NULL;
 }
 
-#if defined( __APPLE__ )
-#include "../lib/libvlc_internal.h" /* libvlc_InternalWait */
-/**
- * MonitorLibVLCDeath: Used when b_should_run_on_first_thread is set.
- *
- * @param p_this: the interface object
- */
-static void * MonitorLibVLCDeath( vlc_object_t * p_this )
-{
-    intf_thread_t *p_intf = (intf_thread_t *)p_this;
-    libvlc_int_t * p_libvlc = p_intf->p_libvlc;
-    int canc = vlc_savecancel ();
-
-    libvlc_InternalWait( p_libvlc );
-
-    vlc_object_kill( p_intf ); /* Kill the stupid first thread interface */
-    vlc_restorecancel (canc);
-    return NULL;
-}
-#endif
-
 static int AddIntfCallback( vlc_object_t *p_this, char const *psz_cmd,
                          vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {



More information about the vlc-commits mailing list