mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
[358/906] gstgldisplay: Close a small race starting the display thread
Take the display lock before signalling the create-context cond to ensure the caller has dropped the lock and is therefore listening for the signal.
This commit is contained in:
parent
4ddbded3a8
commit
8884cfefa8
1 changed files with 4 additions and 0 deletions
|
@ -531,6 +531,7 @@ gst_gl_display_thread_create_context (GstGLDisplay * display)
|
|||
{
|
||||
GLenum err = 0;
|
||||
|
||||
gst_gl_display_lock (display);
|
||||
display->gl_window =
|
||||
gst_gl_window_new (display->upload_width, display->upload_height,
|
||||
display->external_gl_context);
|
||||
|
@ -539,6 +540,7 @@ gst_gl_display_thread_create_context (GstGLDisplay * display)
|
|||
display->isAlive = FALSE;
|
||||
GST_ERROR_OBJECT (display, "Failed to create gl window");
|
||||
g_cond_signal (display->cond_create_context);
|
||||
gst_gl_display_unlock (display);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -602,6 +604,8 @@ gst_gl_display_thread_create_context (GstGLDisplay * display)
|
|||
|
||||
g_cond_signal (display->cond_create_context);
|
||||
|
||||
gst_gl_display_unlock (display);
|
||||
|
||||
gst_gl_window_run_loop (display->gl_window);
|
||||
|
||||
GST_INFO ("loop exited\n");
|
||||
|
|
Loading…
Reference in a new issue