From ad91982481c386e7df642866f8fd8f029b325edf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20Ni=C3=9Fl?= Date: Sun, 4 Jan 2009 18:21:11 +0100 Subject: Introduce XVMC_LOCKDISPLAY_SAFE to solve deadlocks in certain xxmc implementations. Some implementations are buggy and lock resources (for example the display or internal data structures) in different order, which results in deadlocks. As XVMC_LOCKDISPLAY_SAFE is not defined by default, most API functions will now be guarded by a LockDisplay()/UnlockDisplay() pair, which imposes a lock order at least for the resource display and hence avoids those deadlocks. --- src/video_out/xxmc.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h index 9aea10854..edb440a14 100644 --- a/src/video_out/xxmc.h +++ b/src/video_out/xxmc.h @@ -37,6 +37,14 @@ #define XVMC_THREAD_SAFE +/* + * some implementations are not aware of the display having been locked + * already before calling the xvmc function and may therefore deadlock. + */ +/* +#define XVMC_LOCKDISPLAY_SAFE +*/ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -170,7 +178,7 @@ typedef struct context_lock_s { return; \ } -#ifdef XVMC_THREAD_SAFE +#if defined(XVMC_THREAD_SAFE) && defined(XVMC_LOCKDISPLAY_SAFE) #define XVMCLOCKDISPLAY(display) #define XVMCUNLOCKDISPLAY(display) #else -- cgit v1.2.3