[gst-devel] "threadsafe" signals

Colin Walters walters at verbum.org
Sat Jan 10 12:55:00 CET 2004


On Fri, 2004-01-09 at 20:07, Benjamin Otte wrote:

> I'd like to not limit it to the main thread only. Especially because this
> allows to connect safely from any thread to any thread so you could even
> use it in applications to connect to signals from library threads and
> stuff like that.

No no, what I'm saying is to do it like this:

static gboolean
my_emit_signal_idle (...)
{
  g_signal_emit (...)
  return FALSE;
}

static void 
my_emit_signal (...)
{
  if (gst_in_main_thread ())
    my_emit_signal_idle (...)
  else
    g_idle_add ((GSourceFunc) my_emit_signal_idle, ...)
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20040110/d7fe5c60/attachment.pgp>


More information about the gstreamer-devel mailing list