/*****************************************************************************
* Function definitions
*****************************************************************************/
+VLC_EXPORT( void, __vlc_threads_error, ( vlc_object_t *) );
VLC_EXPORT( int, __vlc_mutex_init, ( vlc_object_t *, vlc_mutex_t * ) );
VLC_EXPORT( int, __vlc_mutex_destroy, ( const char *, int, vlc_mutex_t * ) );
VLC_EXPORT( int, __vlc_cond_init, ( vlc_object_t *, vlc_cond_t * ) );
VLC_EXPORT( void, __vlc_thread_ready, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t *, const char *, int ) );
+/*****************************************************************************
+ * vlc_threads_error: Signalize an error in the threading system
+ *****************************************************************************/
+#define vlc_threads_error( P_THIS ) \
+ __vlc_threads_error( VLC_OBJECT(P_THIS) )
+
/*****************************************************************************
* vlc_threads_init: initialize threads system
*****************************************************************************/
msg_Err( p_mutex->p_this,
"thread %li: mutex_lock failed at %s:%d (%d:%m)",
i_thread, psz_file, i_line, i_result );
+ vlc_threads_error( p_mutex->p_this );
}
return i_result;
}
msg_Err( p_mutex->p_this,
"thread %li: mutex_unlock failed at %s:%d (%d:%m)",
i_thread, psz_file, i_line, i_result );
+ vlc_threads_error( p_mutex->p_this );
}
return i_result;
msg_Err( p_condvar->p_this,
"thread %li: cond_signal failed at %s:%d (%d:%m)",
i_thread, psz_file, i_line, i_result );
+ vlc_threads_error( p_condvar->p_this );
}
return i_result;
msg_Err( p_condvar->p_this,
"thread %li: cond_wait failed at %s:%d (%d:%m)",
i_thread, psz_file, i_line, i_result );
+ vlc_threads_error( p_condvar->p_this );
}
return i_result;
msg_Err( p_condvar->p_this,
"thread %li: cond_wait failed at %s:%d (%d:%m)",
i_thread, psz_file, i_line, i_res );
+ vlc_threads_error( p_condvar->p_this );
}
return i_res;
vlc_threadvar_t msg_context_global_key;
+/*****************************************************************************
+ * vlc_threads_error: Report an error from the threading mecanism
+ *****************************************************************************
+ * This is especially useful to debug those errors, as this is a nice symbol
+ * on which you can break.
+ *****************************************************************************/
+void
+__vlc_threads_error( vlc_object_t *p_this )
+{
+ msg_Err( p_this, "Error detected. Put a breakpoint in '%s' to debug.",
+ __func__ );
+}
+
/*****************************************************************************
* vlc_threads_init: initialize threads system
*****************************************************************************
msg_Err( p_mutex->p_this,
"thread %d: mutex_destroy failed at %s:%d (%d:%m)",
i_thread, psz_file, i_line, i_result );
+ vlc_threads_error( p_mutex->p_this );
}
return i_result;
}
msg_Err( p_condvar->p_this,
"thread %d: cond_destroy failed at %s:%d (%d:%m)",
i_thread, psz_file, i_line, i_result );
+ vlc_threads_error( p_condvar->p_this );
}
return i_result;
}
errno = i_ret;
msg_Err( p_this, "%s thread could not be created at %s:%d (%m)",
psz_name, psz_file, i_line );
+ vlc_threads_error( p_this );
vlc_mutex_unlock( &p_this->object_lock );
}
msg_Err( p_this, "thread_join(%u) failed at %s:%d (%s)",
(unsigned int)p_priv->thread_id.id,
psz_file, i_line, GetLastError() );
+ vlc_threads_error( p_this );
p_priv->b_thread = VLC_FALSE;
return;
}
errno = i_ret;
msg_Err( p_this, "thread_join(%u) failed at %s:%d (%m)",
(unsigned int)p_priv->thread_id, psz_file, i_line );
+ vlc_threads_error( p_this );
}
else
{