Commit 5483afb5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

De-inline vlc_assert_locked()

parent fb79b01e
...@@ -63,8 +63,7 @@ void vlc_trace (const char *fn, const char *file, unsigned line); ...@@ -63,8 +63,7 @@ void vlc_trace (const char *fn, const char *file, unsigned line);
#define vlc_backtrace() vlc_trace(__func__, __FILE__, __LINE__) #define vlc_backtrace() vlc_trace(__func__, __FILE__, __LINE__)
#if defined (LIBVLC_USE_PTHREAD) && !defined (NDEBUG) #if defined (LIBVLC_USE_PTHREAD) && !defined (NDEBUG)
# define vlc_assert_locked( m ) \ void vlc_assert_locked (vlc_mutex_t *);
assert (pthread_mutex_lock (m) == EDEADLK)
#else #else
# define vlc_assert_locked( m ) (void)m # define vlc_assert_locked( m ) (void)m
#endif #endif
......
...@@ -356,6 +356,13 @@ void vlc_mutex_destroy (vlc_mutex_t *p_mutex) ...@@ -356,6 +356,13 @@ void vlc_mutex_destroy (vlc_mutex_t *p_mutex)
#endif #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. * Acquires a mutex. If needed, waits for any other thread to release it.
* Beware of deadlocks when locking multiple mutexes at the same time, * Beware of deadlocks when locking multiple mutexes at the same time,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment