[gst-devel] "threadsafe" signals
Benjamin Otte
in7y118 at public.uni-hamburg.de
Fri Jan 9 10:46:02 CET 2004
Attached is a file that implements a general way to do threadsafe signal
marshalling into main contexts. It works on every signal, regardless of
prototype.
This is done the following way:
- When the handler should be emitted, the closure instead adds an idle
handler with highest priority to the (a) main context.
- After that the thread blocks until the main context has handled the
signal.
- Then it continues.
This has 2 problems:
1) It blocks execution of the thread until the main context feels free
to handle the signal. (Note: only when there's actually a handler
connected, not by default)
2) If the signal isn't emitted in a thread but from the main context, you
get a deadlock.
Do we want this in gstreamer core?
Benjamin
PS: Thanks to Mike for pointing out that using a custom closure is a
cool way to handle this.
More information about the gstreamer-devel
mailing list