Commit 2479ed41 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Don't try to lock locked mutexes under valgrind

This removes a lot of false true positives.
parent 5483afb5
...@@ -357,8 +357,16 @@ void vlc_mutex_destroy (vlc_mutex_t *p_mutex) ...@@ -357,8 +357,16 @@ void vlc_mutex_destroy (vlc_mutex_t *p_mutex)
} }
#if defined(LIBVLC_USE_PTHREAD) && !defined(NDEBUG) #if defined(LIBVLC_USE_PTHREAD) && !defined(NDEBUG)
# ifdef HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
# else
# define RUNNING_ON_VALGRIND (0)
# endif
void vlc_assert_locked (vlc_mutex_t *p_mutex) void vlc_assert_locked (vlc_mutex_t *p_mutex)
{ {
if (RUNNING_ON_VALGRIND > 0)
return;
assert (pthread_mutex_lock (p_mutex) == EDEADLK); assert (pthread_mutex_lock (p_mutex) == EDEADLK);
} }
#endif #endif
......
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