+static vlc_mutex_t intf_lock = VLC_STATIC_MUTEX;
+
+int interaction_Register( intf_thread_t *intf )
+{
+ libvlc_priv_t *priv = libvlc_priv( intf->p_libvlc );
+ int ret = VLC_EGENERIC;
+
+ vlc_mutex_lock( &intf_lock );
+ if( priv->p_interaction_intf == NULL )
+ { /* Since the interface is responsible for unregistering itself before
+ * it terminates, an object reference is not needed. */
+ priv->p_interaction_intf = intf;
+ ret = VLC_SUCCESS;
+ }
+ vlc_mutex_unlock( &intf_lock );
+ return ret;
+}
+
+int interaction_Unregister( intf_thread_t *intf )
+{
+ libvlc_priv_t *priv = libvlc_priv( intf->p_libvlc );
+ int ret = VLC_EGENERIC;
+
+ vlc_mutex_lock( &intf_lock );
+ if( priv->p_interaction_intf == intf )
+ {
+ priv->p_interaction_intf = NULL;
+ ret = VLC_SUCCESS;
+ }
+ vlc_mutex_unlock( &intf_lock );
+ return ret;
+}
+