]> git.sesse.net Git - vlc/blobdiff - src/misc/threads.c
De-inline vlc_assert_locked()
[vlc] / src / misc / threads.c
index 26a66a9172f38af3ff5c419ce0f0c712d61e7933..2b13262bf9097293d909adf63b051974dfb2a35f 100644 (file)
@@ -356,6 +356,13 @@ void vlc_mutex_destroy (vlc_mutex_t *p_mutex)
 #endif
 }
 
+#if defined(LIBVLC_USE_PTHREAD) && !defined(NDEBUG)
+void vlc_assert_locked (vlc_mutex_t *p_mutex)
+{
+    assert (pthread_mutex_lock (p_mutex) == EDEADLK);
+}
+#endif
+
 /**
  * Acquires a mutex. If needed, waits for any other thread to release it.
  * Beware of deadlocks when locking multiple mutexes at the same time,