+2005-11-04 Wim Taymans <wim@fluendo.com>
+
+ * gst/gstbus.c: (gst_bus_class_init), (gst_bus_init),
+ (gst_bus_post):
+ Get the context to wake up only once.
+
2005-11-03 Wim Taymans <wim@fluendo.com>
* check/states/sinks.c: (GST_START_TEST):
static GstObjectClass *parent_class = NULL;
static guint gst_bus_signals[LAST_SIGNAL] = { 0 };
+/* the context we wakeup when we posted a message on the bus */
+static GMainContext *main_context;
+
GType
gst_bus_get_type (void)
{
G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED,
G_STRUCT_OFFSET (GstBusClass, message), NULL, NULL,
marshal_VOID__MINIOBJECT, G_TYPE_NONE, 1, GST_TYPE_MESSAGE);
+
+ main_context = g_main_context_default ();
}
static void
bus->queue_lock = g_mutex_new ();
GST_DEBUG_OBJECT (bus, "created");
-
- return;
}
static void
g_mutex_unlock (bus->queue_lock);
GST_DEBUG_OBJECT (bus, "[msg %p] pushed on async queue", message);
- /* FIXME cannot assume the source is only in the default context */
- g_main_context_wakeup (NULL);
+ /* FIXME cannot assume sources are only in the default context */
+ g_main_context_wakeup (main_context);
break;
case GST_BUS_ASYNC:
g_queue_push_tail (bus->queue, message);
g_mutex_unlock (bus->queue_lock);
- /* FIXME cannot assume the source is only in the default context */
- g_main_context_wakeup (NULL);
+ /* FIXME cannot assume sources are only in the default context */
+ g_main_context_wakeup (main_context);
/* now block till the message is freed */
g_cond_wait (cond, lock);