From 6766b6a4a220c42fd666f8648e60959b926a8d31 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 5 Jan 2009 15:41:00 +0000 Subject: [PATCH] gst/gstbus.c: The lock order should be maincontext > OBJECT_LOCK so we need to release the object lock when waking up... Original commit message from CVS: * gst/gstbus.c: (gst_bus_wakeup_main_context): The lock order should be maincontext > OBJECT_LOCK so we need to release the object lock when waking up the mainloop to avoid deadlocks. --- ChangeLog | 6 ++++++ gst/gstbus.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9509ad70e9..e17f1c3b68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-01-05 Wim Taymans + + * gst/gstbus.c: (gst_bus_wakeup_main_context): + The lock order should be maincontext > OBJECT_LOCK so we need to release + the object lock when waking up the mainloop to avoid deadlocks. + 2009-01-05 Wim Taymans * gst/gstbin.c: (gst_bin_set_index_func), (gst_bin_set_clock_func), diff --git a/gst/gstbus.c b/gst/gstbus.c index f635034e76..670e9b24d5 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -298,9 +298,17 @@ gst_bus_get_property (GObject * object, guint prop_id, static void gst_bus_wakeup_main_context (GstBus * bus) { + GMainContext *ctx; + GST_OBJECT_LOCK (bus); - g_main_context_wakeup (bus->priv->main_context); + if ((ctx = bus->priv->main_context)) + g_main_context_ref (ctx); GST_OBJECT_UNLOCK (bus); + + g_main_context_wakeup (ctx); + + if (ctx) + g_main_context_unref (ctx); } static void