#define var_Command(a,b,c,d,e) __var_Command( VLC_OBJECT( a ), b, c, d, e )
VLC_EXPORT( int, __var_Command, ( vlc_object_t *, const char *, const char *, const char *, char ** ) );
+VLC_EXPORT( vlc_mutex_t *, var_GetGlobalMutex, ( const char * ) );
+
/**
* __var_Create() with automatic casting.
*/
return VLC_SUCCESS;
}
+
+/**
+ * Gets a process-wide mutex, creates it if needed.
+ */
+vlc_mutex_t *var_GetGlobalMutex( const char *name )
+{
+ libvlc_global_data_t *p_global = vlc_global_object();
+ vlc_value_t val;
+
+ if( var_Create( p_global, name, VLC_VAR_MUTEX ) )
+ return NULL;
+
+ var_Get( p_global, &val );
+ return val.p_lockval;
+}
+
+
/**
* Register a callback in a variable
*