VLC_EXPORT( int, vlc_cond_timedwait, (vlc_cond_t *, vlc_mutex_t *, mtime_t) );
VLC_EXPORT( int, vlc_threadvar_create, (vlc_threadvar_t * , void (*) (void *) ) );
VLC_EXPORT( void, vlc_threadvar_delete, (vlc_threadvar_t *) );
-VLC_EXPORT( int, __vlc_thread_create, ( vlc_object_t *, const char *, int, const char *, void * ( * ) ( vlc_object_t * ), int, bool ) );
+VLC_EXPORT( int, vlc_thread_create, ( vlc_object_t *, const char *, int, const char *, void * ( * ) ( vlc_object_t * ), int ) );
VLC_EXPORT( int, __vlc_thread_set_priority, ( vlc_object_t *, const char *, int, int ) );
VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t * ) );
/*****************************************************************************
* vlc_thread_create: create a thread
*****************************************************************************/
-#define vlc_thread_create( P_THIS, PSZ_NAME, FUNC, PRIORITY, WAIT ) \
- __vlc_thread_create( VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, FUNC, PRIORITY, WAIT )
+#define vlc_thread_create( P_THIS, PSZ_NAME, FUNC, PRIORITY ) \
+ vlc_thread_create( VLC_OBJECT(P_THIS), __FILE__, __LINE__, PSZ_NAME, FUNC, PRIORITY )
/*****************************************************************************
* vlc_thread_set_priority: set the priority of the calling thread
p_sys->p_ev->pp_last = &p_sys->p_ev->p_frame;
p_sys->p_ev->p_access = p_access;
vlc_mutex_init( &p_sys->p_ev->lock );
- vlc_thread_create( p_sys->p_ev, "dv event thread handler", Raw1394EventThread,
- VLC_THREAD_PRIORITY_OUTPUT, false );
+ vlc_thread_create( p_sys->p_ev, "dv event thread handler",
+ Raw1394EventThread, VLC_THREAD_PRIORITY_OUTPUT );
free( psz_name );
return VLC_SUCCESS;
p_sys->p_ev = vlc_object_create( p_demux, sizeof( event_thread_t ) );
p_sys->p_ev->p_demux = p_demux;
vlc_thread_create( p_sys->p_ev, "dvdnav event thread handler", EventThread,
- VLC_THREAD_PRIORITY_LOW, false );
+ VLC_THREAD_PRIORITY_LOW );
return VLC_SUCCESS;
}
}
if( vlc_thread_create( p_sys->p_thread, "rtmp control thread", ThreadControl,
- VLC_THREAD_PRIORITY_INPUT, false ) )
+ VLC_THREAD_PRIORITY_INPUT ) )
{
msg_Err( p_access, "cannot spawn rtmp control thread" );
goto error2;
if( vlc_thread_create( p_sys->poll_thread, "Avahi Poll Iterate Thread",
poll_iterate_thread,
- VLC_THREAD_PRIORITY_HIGHEST, false ) )
+ VLC_THREAD_PRIORITY_HIGHEST ) )
{
msg_Err( p_sys->p_log, "failed to create poll iterate thread" );
goto error;
}
if( vlc_thread_create( p_sys->p_thread, "rtmp control thread", ThreadControl,
- VLC_THREAD_PRIORITY_INPUT, false ) )
+ VLC_THREAD_PRIORITY_INPUT ) )
{
msg_Err( p_access, "cannot spawn rtmp control thread" );
goto error2;
p_sys->p_buffer = NULL;
if( vlc_thread_create( p_sys->p_thread, "sout write thread", ThreadWrite,
- VLC_THREAD_PRIORITY_HIGHEST, false ) )
+ VLC_THREAD_PRIORITY_HIGHEST ) )
{
msg_Err( p_access, "cannot spawn sout access thread" );
net_Close (i_handle);
/* Create ALSA thread and wait for its readiness. */
if( vlc_thread_create( p_aout, "aout", ALSAThread,
- VLC_THREAD_PRIORITY_OUTPUT, false ) )
+ VLC_THREAD_PRIORITY_OUTPUT ) )
{
msg_Err( p_aout, "cannot create ALSA thread (%m)" );
goto error;
if( vlc_thread_create( p_aout->output.p_sys->p_notif,
"DirectSound Notification Thread",
DirectSoundThread,
- VLC_THREAD_PRIORITY_HIGHEST, false ) )
+ VLC_THREAD_PRIORITY_HIGHEST ) )
{
msg_Err( p_aout, "cannot create DirectSoundThread" );
CloseHandle( p_aout->output.p_sys->p_notif->event );
/* Create thread and wait for its readiness. */
if( vlc_thread_create( p_aout, "aout", Thread,
- VLC_THREAD_PRIORITY_OUTPUT, false ) )
+ VLC_THREAD_PRIORITY_OUTPUT ) )
{
msg_Err( p_aout, "cannot create OSS thread (%m)" );
pPlayer->Close();
/* Create OSS thread and wait for its readiness. */
if( vlc_thread_create( p_aout, "aout", OSSThread,
- VLC_THREAD_PRIORITY_OUTPUT, false ) )
+ VLC_THREAD_PRIORITY_OUTPUT ) )
{
msg_Err( p_aout, "cannot create OSS thread (%m)" );
close( p_sys->i_fd );
/* Create PORTAUDIOThread */
if( vlc_thread_create( pa_thread, "aout", PORTAUDIOThread,
- VLC_THREAD_PRIORITY_OUTPUT, false ) )
+ VLC_THREAD_PRIORITY_OUTPUT ) )
{
msg_Err( p_aout, "cannot create PORTAUDIO thread" );
return VLC_EGENERIC;
/* Then launch the notification thread */
if( vlc_thread_create( p_aout->output.p_sys->p_notif,
"waveOut Notification Thread", WaveOutThread,
- VLC_THREAD_PRIORITY_OUTPUT, false ) )
+ VLC_THREAD_PRIORITY_OUTPUT ) )
{
msg_Err( p_aout, "cannot create WaveOutThread" );
}
pp_contexts[i]->b_work = 0;
pp_contexts[i]->b_done = 0;
if ( vlc_thread_create( pp_contexts[i], "encoder", FfmpegThread,
- VLC_THREAD_PRIORITY_VIDEO, false ) )
+ VLC_THREAD_PRIORITY_VIDEO ) )
{
msg_Err( p_enc, "cannot spawn encoder thread, expect to die soon" );
return NULL;
p_ev->b_die = false;
vlc_mutex_init( &p_ev->lock );
vlc_thread_create( p_ev, "mkv event thread handler", EventThread,
- VLC_THREAD_PRIORITY_LOW, false );
+ VLC_THREAD_PRIORITY_LOW );
}
}
/* Create audio thread and wait for its readiness. */
if( vlc_thread_create( p_aout, "aout", QNXaoutThread,
- VLC_THREAD_PRIORITY_OUTPUT, false ) )
+ VLC_THREAD_PRIORITY_OUTPUT ) )
{
msg_Err( p_aout, "cannot create QNX audio thread (%m)" );
CloseAudio( p_this );
/* Create a new thread for the dialogs provider */
p_intf->p_sys->thread_ready = CreateEvent (NULL, TRUE, FALSE, NULL);
- if( vlc_thread_create( p_intf, "WinCE Dialogs Thread",
- MainLoop, 0, false ) )
+ if( vlc_thread_create( p_intf, "WinCE Dialogs Thread", MainLoop, 0 ) )
{
msg_Err( p_intf, "cannot create WinCE Dialogs Thread" );
p_intf->pf_show_dialog = NULL;
/* The module is used in dialog provider mode */
/* Create a new thread for wxWidgets */
- if( vlc_thread_create( p_intf, "Skins Dialogs Thread",
- Init, 0, true ) )
+ if( vlc_thread_create( p_intf, "Skins Dialogs Thread", Init, 0 ) )
{
msg_Err( p_intf, "cannot create Skins Dialogs Thread" );
p_intf->pf_show_dialog = NULL;
if( vlc_thread_create( p_fontbuilder,
"fontlist builder",
FontBuilderThread,
- VLC_THREAD_PRIORITY_LOW,
- false ) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Warn( p_filter, "fontconfig database builder thread can't "
"be launched. Font styling support will be limited." );
p_sys->p_fifo_cmd = block_FifoNew();
if( vlc_thread_create( p_vod, "rtsp vod thread", CommandThread,
- VLC_THREAD_PRIORITY_LOW, false ) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_vod, "cannot spawn rtsp vod thread" );
block_FifoRelease( p_sys->p_fifo_cmd );
id->p_fifo = block_FifoNew();
if( vlc_thread_create( id, "RTP send thread", ThreadSend,
- VLC_THREAD_PRIORITY_HIGHEST, false ) )
+ VLC_THREAD_PRIORITY_HIGHEST ) )
goto error;
/* Update p_sys context */
p_sys->i_last_pic = 0;
p_sys->p_buffers = NULL;
p_sys->b_die = p_sys->b_error = 0;
- if( vlc_thread_create( p_sys, "encoder", EncoderThread, i_priority,
- false ) )
+ if( vlc_thread_create( p_sys, "encoder", EncoderThread, i_priority ) )
{
msg_Err( p_stream, "cannot spawn encoder thread" );
module_unneed( id->p_decoder, id->p_decoder->p_module );
if(vlc_thread_create( m_pAtmoThread,
"Atmo-CThread-Class",
CThread::ThreadProc,
- VLC_THREAD_PRIORITY_LOW,
- false ))
+ VLC_THREAD_PRIORITY_LOW ))
{
msg_Err( m_pOwner, "cannot launch one of the AtmoLight threads");
}
if( vlc_thread_create( p_sys->p_fadethread,
"AtmoLight fadeing",
FadeToColorThread,
- VLC_THREAD_PRIORITY_LOW,
- false ) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_filter, "cannot create FadeToColorThread" );
vlc_object_release( p_sys->p_fadethread );
if( vlc_thread_create( p_sys->p_fadethread,
"AtmoLight fadeing",
FadeToColorThread,
- VLC_THREAD_PRIORITY_LOW,
- false) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_filter, "cannot create FadeToColorThread" );
vlc_object_release( p_sys->p_fadethread );
sizeof( vlc_object_t ) );
vlc_object_attach( p_sys->p_worker_thread, p_this );
if( vlc_thread_create( p_sys->p_worker_thread, "vnc worker thread",
- vnc_worker_thread,
- VLC_THREAD_PRIORITY_LOW, false ) )
+ vnc_worker_thread, VLC_THREAD_PRIORITY_LOW ) )
{
vlc_object_detach( p_sys->p_worker_thread );
vlc_object_release( p_sys->p_worker_thread );
vlc_object_attach( p_update_request_thread, p_filter );
if( vlc_thread_create( p_update_request_thread,
"vnc update request thread",
- update_request_thread,
- VLC_THREAD_PRIORITY_LOW, false ) )
+ update_request_thread, VLC_THREAD_PRIORITY_LOW ) )
{
vlc_object_detach( p_update_request_thread );
vlc_object_release( p_update_request_thread );
p_vout->p_sys->p_event->p_vout = p_vout;
p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0, false ) )
+ EventThread, 0 ) )
{
msg_Err( p_vout, "cannot create Vout EventThread" );
CloseHandle( p_vout->p_sys->p_event->window_ready );
p_vout->p_sys->p_event->p_vout = p_vout;
p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0, false ) )
+ EventThread, 0 ) )
{
msg_Err( p_vout, "cannot create Vout EventThread" );
CloseHandle( p_vout->p_sys->p_event->window_ready );
p_vout->p_sys->p_event->p_vout = p_vout;
p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0, false ) )
+ EventThread, 0 ) )
{
msg_Err( p_vout, "cannot create Vout EventThread" );
CloseHandle( p_vout->p_sys->p_event->window_ready );
p_vout->p_sys->p_event->p_vout = p_vout;
p_vout->p_sys->p_event->window_ready = CreateEvent( NULL, TRUE, FALSE, NULL );
if( vlc_thread_create( p_vout->p_sys->p_event, "Vout Events Thread",
- EventThread, 0, false ) )
+ EventThread, 0 ) )
{
msg_Err( p_vout, "cannot create Vout EventThread" );
CloseHandle( p_vout->p_sys->p_event->window_ready );
p_thread->psz_title = TitleGet( VLC_OBJECT( p_filter ) );
if( vlc_thread_create( p_thread, "galaktos update thread", Thread,
- VLC_THREAD_PRIORITY_LOW, false ) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_filter, "cannot lauch galaktos thread" );
free( p_thread->psz_title );
p_thread->psz_title = TitleGet( VLC_OBJECT( p_filter ) );
if( vlc_thread_create( p_thread, "Goom Update Thread", Thread,
- VLC_THREAD_PRIORITY_LOW, false ) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_filter, "cannot lauch goom thread" );
vlc_object_release( p_thread->p_vout );
i_priority = VLC_THREAD_PRIORITY_VIDEO;
/* Spawn the decoder thread */
- if( vlc_thread_create( p_dec, "decoder", DecoderThread,
- i_priority, false ) )
+ if( vlc_thread_create( p_dec, "decoder", DecoderThread, i_priority ) )
{
msg_Err( p_dec, "cannot spawn decoder thread" );
module_unneed( p_dec, p_dec->p_module );
p_sys->b_delayed = true;
if( vlc_thread_create( p_ts, "es out timeshift",
- TsRun, VLC_THREAD_PRIORITY_INPUT, false ) )
+ TsRun, VLC_THREAD_PRIORITY_INPUT ) )
{
msg_Err( p_sys->p_input, "cannot create input thread" );
/* Create thread and wait for its readiness. */
if( vlc_thread_create( p_input, "input", Run,
- VLC_THREAD_PRIORITY_INPUT, false ) )
+ VLC_THREAD_PRIORITY_INPUT ) )
{
input_ChangeState( p_input, ERROR_S );
msg_Err( p_input, "cannot create input thread" );
else
{
if( vlc_thread_create( p_input, "input", RunAndDestroy,
- VLC_THREAD_PRIORITY_INPUT, false ) )
+ VLC_THREAD_PRIORITY_INPUT ) )
{
input_ChangeState( p_input, ERROR_S );
msg_Err( p_input, "cannot create input thread" );
}
if( vlc_thread_create( s, "stream out", DStreamThread,
- VLC_THREAD_PRIORITY_INPUT, false ) )
+ VLC_THREAD_PRIORITY_INPUT ) )
{
stream_CommonDelete( s );
free( p_sys->psz_name );
if( p_intf->b_should_run_on_first_thread )
{
if( vlc_thread_create( p_intf, "interface", MonitorLibVLCDeath,
- VLC_THREAD_PRIORITY_LOW, false ) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_intf, "cannot spawn libvlc death monitoring thread" );
return VLC_EGENERIC;
#endif
/* Run the interface in a separate thread */
if( vlc_thread_create( p_intf, "interface", RunInterface,
- VLC_THREAD_PRIORITY_LOW, false ) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_intf, "cannot spawn interface thread" );
return VLC_EGENERIC;
vlc_strlcpy
vlc_strtoll
vlc_submodule_create
-__vlc_thread_create
+vlc_thread_create
__vlc_thread_join
__vlc_thread_set_priority
vlc_threadvar_create
return NULL;
}
+#undef vlc_thread_create
/*****************************************************************************
- * vlc_thread_create: create a thread, inner version
+ * vlc_thread_create: create a thread
*****************************************************************************
* Note that i_priority is only taken into account on platforms supporting
* userland real-time priority threads.
*****************************************************************************/
-int __vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line,
- const char *psz_name, void * ( *func ) ( vlc_object_t * ),
- int i_priority, bool b_wait )
+int vlc_thread_create( vlc_object_t *p_this, const char * psz_file, int i_line,
+ const char *psz_name, void *(*func) ( vlc_object_t * ),
+ int i_priority )
{
int i_ret;
vlc_object_internals_t *p_priv = vlc_internals( p_this );
p_priv->b_thread = true;
i_ret = vlc_clone( &p_priv->thread_id, thread_entry, boot, i_priority );
if( i_ret == 0 )
- {
msg_Dbg( p_this, "thread (%s) created at priority %d (%s:%d)",
psz_name, i_priority, psz_file, i_line );
- assert( !b_wait );
- }
else
{
p_priv->b_thread = false;
p_uct->p_data = p_data;
vlc_thread_create( p_uct, "check for update", update_CheckReal,
- VLC_THREAD_PRIORITY_LOW, false );
+ VLC_THREAD_PRIORITY_LOW );
}
void* update_CheckReal( vlc_object_t* p_this )
p_udt->psz_destination = destination ? strdup( destination ) : NULL;
vlc_thread_create( p_udt, "download update", update_DownloadReal,
- VLC_THREAD_PRIORITY_LOW, false );
+ VLC_THREAD_PRIORITY_LOW );
}
static void* update_DownloadReal( vlc_object_t *p_this )
/* create the thread */
if( vlc_thread_create( host, "httpd host thread", httpd_HostThread,
- VLC_THREAD_PRIORITY_LOW, false ) )
+ VLC_THREAD_PRIORITY_LOW ) )
{
msg_Err( p_this, "cannot spawn http host thread" );
goto error;