[gst-devel] "threadsafe" signals

Benjamin Otte in7y118 at public.uni-hamburg.de
Sun Jan 11 10:29:01 CET 2004


On Sat, 10 Jan 2004, Colin Walters wrote:

> 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, ...)
> }
>
Which limits you to the main thread (or in this case main context) and
still only allows signal emissions inside one thread, albeit another one.

Benjamin





More information about the gstreamer-devel mailing list