]> git.sesse.net Git - vlc/blobdiff - src/misc/threads.c
vlc_cond_broadcast: broadcast signal on a condition variable
[vlc] / src / misc / threads.c
index 03b31f4c0b5fd37d280e5c9f6f5137c013f1155a..8858cec8b72364cdde441c023eb18e44faeb193f 100644 (file)
@@ -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
  *****************************************************************************/