[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:
Jan Schmidt 2009-07-13 12:53:17 +01:00 committed by Tim-Philipp Müller
parent 4ddbded3a8
commit 8884cfefa8

View file

@ -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");