]> git.sesse.net Git - vlc/blobdiff - src/misc/threads.c
Warn in case of dangerous thread join patterns
[vlc] / src / misc / threads.c
index bd23b3a0ab038a4f21910ec144c180d2fc287b95..9bb111b3f6fa9fe1e0ef3cc1bb73327392239d03 100644 (file)
@@ -695,7 +695,10 @@ void __vlc_thread_join( vlc_object_t *p_this, const char * psz_file, int i_line
     /* Make sure we do return if we are calling vlc_thread_join()
      * from the joined thread */
     if (pthread_equal (pthread_self (), p_priv->thread_id))
+    {
+        msg_Warn (p_this, "joining the active thread (VLC might crash)");
         i_ret = pthread_detach (p_priv->thread_id);
+    }
     else
         i_ret = pthread_join (p_priv->thread_id, NULL);