gstdebug: fix occasional deadlocks on windows when outputting debug logging
authorTim-Philipp Müller <tim@centricular.com>
Wed, 11 Apr 2018 18:56:01 +0000 (19:56 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Wed, 11 Apr 2018 22:12:44 +0000 (23:12 +0100)
commitae612551fa0a2378bfb71eb03611dc6c0861ee7a
treeb6ec2a2f32133d7e72705adcef369de80364046a
parent629bd08e022791ae27eb89714c6cc268d38e6a3b
gstdebug: fix occasional deadlocks on windows when outputting debug logging

When outputting debug logs on Windows, some sections are protected
with a non-recursive lock. Turns out though that gst_debug_message_get()
might indirectly, via our printf format extensions, call code which
in turn would try to log something when it can't handle something. If
that happens we end up in gst_debug_log_default() again recursively and
try to again take the lock that's already taken, thus deadlocking.

Format the debug message string outside of the critical section
instead to avoid this.

https://bugzilla.gnome.org/show_bug.cgi?id=784382
gst/gstinfo.c