Commit f8d586c2 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

vlc_cond_broadcast: broadcast signal on a condition variable

Seems like this is needed for proper vlc_object_kill() (if more than
one thread waits on a given object).
parent 1e101038
......@@ -135,6 +135,7 @@ VLC_EXPORT( int, vlc_mutex_init_recursive, ( vlc_mutex_t * ) );
VLC_EXPORT( void, __vlc_mutex_destroy, ( const char *, int, vlc_mutex_t * ) );
VLC_EXPORT( int, vlc_cond_init, ( vlc_cond_t * ) );
VLC_EXPORT( void, __vlc_cond_destroy, ( const char *, int, vlc_cond_t * ) );
VLC_EXPORT( void, vlc_cond_broadcast, (vlc_cond_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 ) );
......
......@@ -426,6 +426,7 @@ VLC_CompileBy
VLC_CompileDomain
VLC_CompileHost
VLC_Compiler
vlc_cond_broadcast
__vlc_cond_destroy
vlc_cond_init
vlc_config_create
......
......@@ -8,6 +8,7 @@
* Samuel Hocevar <sam@zoy.org>
* Gildas Bazin <gbazin@netcourrier.com>
* Clément Sténac
* Rémi Denis-Courmont
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -373,6 +374,22 @@ void __vlc_cond_destroy( const char * psz_file, int i_line, vlc_cond_t *p_condva
#endif
}
/**
* Wakes up all threads (if any) waiting on a condition variable.
* @param p_cond condition variable
*/
void vlc_cond_broadcast (vlc_cond_t *p_condvar)
{
#if defined (LIBVLC_USE_PTHREAD)
pthread_cond_broadcast (p_condvar);
#elif defined (WIN32)
SetEvent (*p_condvar);
#endif
}
/*****************************************************************************
* vlc_tls_create: create a thread-local variable
*****************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment