summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Nißl <rnissl@gmx.de>2009-01-04 18:21:11 +0100
committerReinhard Nißl <rnissl@gmx.de>2009-01-04 18:21:11 +0100
commit0907a74b5fa7b8b439f1f8f5db239c7586bfb12d (patch)
tree9ce3cb876a74ef54bb37edf571b681b13d577134
parentc4ca0e127e4c3407df8268ec6320576f98c83567 (diff)
downloadxine-lib-0907a74b5fa7b8b439f1f8f5db239c7586bfb12d.tar.gz
xine-lib-0907a74b5fa7b8b439f1f8f5db239c7586bfb12d.tar.bz2
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. (transplanted from 580a2a9148618131cedfbc9058ac7979ca16f69b) --HG-- extra : transplant_source : X%0A%2A%91Ha%811%CE%DF%BC%90X%ACyy%CA%16%F6%9B
-rw-r--r--src/video_out/xxmc.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_out/xxmc.h b/src/video_out/xxmc.h
index 1c24991be..03b12c15b 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
@@ -171,7 +179,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