+ if( vlc_thread_create( p_intf, "interface", MonitorLibVLCDeath,
+ VLC_THREAD_PRIORITY_LOW, false ) )
+ {
+ msg_Err( p_intf, "cannot spawn libvlc death monitoring thread" );
+ return VLC_EGENERIC;
+ }
+ RunInterface( VLC_OBJECT(p_intf) );
+
+ /* Make sure our MonitorLibVLCDeath thread exit */
+ vlc_object_kill( p_intf );
+ /* It is monitoring libvlc, not the p_intf */
+ vlc_object_signal( p_intf->p_libvlc );
+ vlc_thread_join( p_intf );
+
+ vlc_object_detach( p_intf );
+ vlc_object_release( p_intf );