glwindow: don't use g_thread_join() to join the navigation thread
authorMatthew Waters <matthew@centricular.com>
Wed, 5 Oct 2016 07:32:09 +0000 (18:32 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:23 +0000 (19:32 +0000)
commit126ee924c065160738308f7a10241c63ada8bab5
treeebb57c4faee05bf8515768c62e06c3fdcf4f61fa
parentc0cb6eacb56b4d0ef89e6a5e877aabf756d77b40
glwindow: don't use g_thread_join() to join the navigation thread

Using g_thread_join() in _finalize() handlers may result in a deadlock
joining the current thread when the last reference is held by a signal
handler.

e.g.:

error 'Resource deadlock avoided' during 'pthread_join (pt->system_thread, NULL)'

The backtrace looks like this:
[...]
g_thread_join ()
gst_gl_window_finalize ()
gst_gl_window_x11_finalize ()
g_object_unref ()
g_value_unset ()
g_signal_emit_valist ()
g_signal_emit ()
gst_gl_window_send_mouse_event ()
gst_gl_window_mouse_event_cb ()
g_main_dispatch ()
[..]
g_main_loop_run ()
gst_gl_window_navigation_thread ()
g_thread_proxy ()
start_thread ()
clone ()
gst-libs/gst/gl/gstglwindow.c