]> git.sesse.net Git - vlc/blobdiff - include/vlc_threads_funcs.h
Following vlc_object_kill(), add vlc_object_dying()
[vlc] / include / vlc_threads_funcs.h
index c81713689fc0bb99f878d2f19ed6e2f6bd5fbd2a..269287b69c3c980805773ee708cc6237ad93802c 100644 (file)
@@ -122,6 +122,9 @@ static inline int __vlc_mutex_lock( const char * psz_file, int i_line,
     }
 
 #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 )
     {
@@ -144,6 +147,10 @@ static inline int __vlc_mutex_lock( const char * psz_file, int i_line,
     return i_result;
 }
 
+#ifndef vlc_assert_locked
+# define vlc_assert_locked( m ) (void)0
+#endif
+
 /*****************************************************************************
  * vlc_mutex_unlock: unlock a mutex
  *****************************************************************************/