Task: call leave_thread before signaling

Call the leave_thread callback before we signal the thread performing the _join
so that we can be sure that the listener still has valid info in the callback.
This commit is contained in:
Wim Taymans 2009-04-21 14:42:05 +02:00 committed by Wim Taymans
parent e72efeccd1
commit 35eeb4864c

View file

@ -213,13 +213,16 @@ exit:
* before releasing the lock as we can be sure that a ref is held by the
* caller of the join(). */
task->running = FALSE;
if (priv->thr_callbacks.leave_thread) {
/* fire the leave_thread callback when we need to. We need to do this before
* we signal the task and with the task lock released. */
GST_OBJECT_UNLOCK (task);
priv->thr_callbacks.leave_thread (task, tself, priv->thr_user_data);
GST_OBJECT_LOCK (task);
}
GST_TASK_SIGNAL (task);
GST_OBJECT_UNLOCK (task);
/* fire the leave_thread callback when we need to */
if (priv->thr_callbacks.leave_thread)
priv->thr_callbacks.leave_thread (task, tself, priv->thr_user_data);
GST_DEBUG ("Exit task %p, thread %p", task, g_thread_self ());
gst_object_unref (task);