[gst-devel] library functions not returning

David Schleef ds at schleef.org
Fri Feb 20 17:13:33 CET 2004


On Wed, Feb 18, 2004 at 10:46:38AM +0100, Thomas Vander Stichele wrote:
> As a first stab, I was thinking of something like:
> - element about to call a function that we have found can possibly
> deadlock, calls a function on the core (perhaps a scheduler function,
> not sure) that says "the next call I'm going to make could deadlock, so
> set up an alarm on my behalf".
> This call would set up a SIGPROF handler and schedule a PROF signal,
> with the given amount of processing time as a timeout.  It would also do
> the bookkeeping to make sure that the per-thread accounting is done
> correctly (starting with a global mutex for now).  After the function
> call, the element calls a function that removes the alarm, and gets
> whether or not it was alarm'd through an accessor.

I just added gst-sandbox/gst-watchdog, which implements a GstWatchdog
object.  You can create a watchdog object and add GstBins to it.
If any bin fails to iterate in a (default) 5 second period, it will
fire a signal.  Right now, it only looks at bin iterations as a sign
of activity, but that could of course be changed.

It works by creating a watchdog thread, and periodically checking
that each bin's last activity time is not too far in the past.



dave...





More information about the gstreamer-devel mailing list