- // Initialize singletons
- if( OSFactory::instance( p_intf ) == NULL )
- {
- msg_Err( p_intf, "cannot initialize OSFactory" );
- pl_Release( p_intf );
-#if 0
- msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
-#endif
- return VLC_EGENERIC;
- }
- if( AsyncQueue::instance( p_intf ) == NULL )
- {
- msg_Err( p_intf, "cannot initialize AsyncQueue" );
- pl_Release( p_intf );
-#if 0
- msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
-#endif
- return VLC_EGENERIC;
- }
- if( Interpreter::instance( p_intf ) == NULL )
- {
- msg_Err( p_intf, "cannot instanciate Interpreter" );
- pl_Release( p_intf );
-#if 0
- msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
-#endif
- return VLC_EGENERIC;
- }
- if( VarManager::instance( p_intf ) == NULL )
- {
- msg_Err( p_intf, "cannot instanciate VarManager" );
- pl_Release( p_intf );
-#if 0
- msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
-#endif
- return VLC_EGENERIC;
- }
- if( VlcProc::instance( p_intf ) == NULL )
- {
- msg_Err( p_intf, "cannot initialize VLCProc" );
- pl_Release( p_intf );
-#if 0
- msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
-#endif
- return VLC_EGENERIC;
- }
- if( VoutManager::instance( p_intf ) == NULL )
+ vlc_mutex_lock( &p_intf->p_sys->init_lock );
+ p_intf->p_sys->b_error = false;
+ p_intf->p_sys->b_ready = false;
+
+ if( vlc_clone( &p_intf->p_sys->thread, Run, p_intf,
+ VLC_THREAD_PRIORITY_LOW ) )