psz_object_name can only be read from the thread calling module_need()
for the current object. As an alternative, module_need() would have to
be called before vlc_object_attach(), which would break var_CreateGet*.
__attribute__((deprecated))
#endif
VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) );
__attribute__((deprecated))
#endif
VLC_EXPORT( void *, __vlc_object_find, ( vlc_object_t *, int, int ) );
+#if defined (__GNUC__) && !defined __cplusplus
+__attribute__((deprecated))
+#endif
VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) );
VLC_EXPORT( void *, __vlc_object_hold, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
VLC_EXPORT( vlc_object_t *, vlc_object_find_name, ( vlc_object_t *, const char *, int ) );
VLC_EXPORT( void *, __vlc_object_hold, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_release, ( vlc_object_t * ) );
+ /* Reading psz_object_name from a separate inhibits thread-safety.
+ * Use a libvlc address variable instead for that sort of things! */
+ msg_Warn( p_this, "%s(%s) is not safe!", __func__, psz_name );
/* If have the requested name ourselves, don't look further */
if( !(i_mode & FIND_STRICT)
&& p_this->psz_object_name
/* If have the requested name ourselves, don't look further */
if( !(i_mode & FIND_STRICT)
&& p_this->psz_object_name