[vlc-devel] commit: De-inline vlc_assert_locked() ( Rémi Denis-Courmont )
git version control
git at videolan.org
Mon Apr 13 22:42:03 CEST 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Apr 13 23:27:53 2009 +0300| [5483afb58383568246480c6b0df4a676837c4427] | committer: Rémi Denis-Courmont
De-inline vlc_assert_locked()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5483afb58383568246480c6b0df4a676837c4427
---
src/libvlc.h | 3 +--
src/misc/threads.c | 7 +++++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/libvlc.h b/src/libvlc.h
index 4e43412..20c0ff1 100644
--- a/src/libvlc.h
+++ b/src/libvlc.h
@@ -63,8 +63,7 @@ void vlc_trace (const char *fn, const char *file, unsigned line);
#define vlc_backtrace() vlc_trace(__func__, __FILE__, __LINE__)
#if defined (LIBVLC_USE_PTHREAD) && !defined (NDEBUG)
-# define vlc_assert_locked( m ) \
- assert (pthread_mutex_lock (m) == EDEADLK)
+void vlc_assert_locked (vlc_mutex_t *);
#else
# define vlc_assert_locked( m ) (void)m
#endif
diff --git a/src/misc/threads.c b/src/misc/threads.c
index 26a66a9..2b13262 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -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,
More information about the vlc-devel
mailing list