VLC_EXPORT( void *, __vlc_object_create, ( vlc_object_t *, int ) );
VLC_EXPORT( void, __vlc_object_destroy, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_kill, ( vlc_object_t * ) );
+VLC_EXPORT( vlc_bool_t, __vlc_object_dying_unlocked, ( vlc_object_t * ) );
+VLC_EXPORT( vlc_bool_t, __vlc_object_dying, ( vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_attach, ( vlc_object_t *, vlc_object_t * ) );
VLC_EXPORT( void, __vlc_object_detach, ( vlc_object_t * ) );
VLC_EXPORT( void *, __vlc_object_get, ( vlc_object_t *, int ) );
}
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
+# define vlc_assert_locked( m ) \
+ assert (pthread_mutex_lock (&((m)->mutex)) == EDEADLK)
+
i_result = pthread_mutex_lock( &p_mutex->mutex );
if ( i_result )
{
return i_result;
}
+#ifndef vlc_assert_locked
+# define vlc_assert_locked( m ) (void)0
+#endif
+
/*****************************************************************************
* vlc_mutex_unlock: unlock a mutex
*****************************************************************************/
}
+vlc_bool_t __vlc_object_dying_unlocked( vlc_object_t *p_this )
+{
+ vlc_assert_locked( &p_this->object_lock );
+ return p_this->b_die;
+}
+
+
+vlc_bool_t __vlc_object_dying( vlc_object_t *p_this )
+{
+ vlc_bool_t b;
+ vlc_mutex_lock( &p_this->object_lock );
+ b = __vlc_object_dying_unlocked( p_this );
+ vlc_mutex_unlock( &p_this->object_lock );
+ return b;
+}
+
+
/**
* find an object given its ID
*