mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
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:
parent
e72efeccd1
commit
35eeb4864c
1 changed files with 7 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue