* and gst_task_stop() respectively or with the gst_task_set_state() function.
*
* A #GstTask will repeatedly call the #GstTaskFunction with the user data
- * that was provided when creating the task with gst_task_create(). While calling
+ * that was provided when creating the task with gst_task_new(). While calling
* the function it will acquire the provided lock. The provided lock is released
* when the task pauses or stops.
*
task->priv = GST_TASK_GET_PRIVATE (task);
task->running = FALSE;
- task->abidata.ABI.thread = NULL;
+ task->thread = NULL;
task->lock = NULL;
task->cond = g_cond_new ();
SET_TASK_STATE (task, GST_TASK_STOPPED);
lock = GST_TASK_GET_LOCK (task);
if (G_UNLIKELY (lock == NULL))
goto no_lock;
- task->abidata.ABI.thread = tself;
+ task->thread = tself;
/* only update the priority when it was changed */
if (priv->prio_set)
g_thread_set_priority (tself, priv->priority);
if (G_UNLIKELY (GET_TASK_STATE (task) == GST_TASK_PAUSED)) {
GST_OBJECT_LOCK (task);
while (G_UNLIKELY (GST_TASK_STATE (task) == GST_TASK_PAUSED)) {
- gint t;
+ g_static_rec_mutex_unlock (lock);
- t = g_static_rec_mutex_unlock_full (lock);
- if (t <= 0) {
- g_warning ("wrong STREAM_LOCK count %d", t);
- }
GST_TASK_SIGNAL (task);
GST_TASK_WAIT (task);
GST_OBJECT_UNLOCK (task);
/* locking order.. */
- if (t > 0)
- g_static_rec_mutex_lock_full (lock, t);
+ g_static_rec_mutex_lock (lock);
GST_OBJECT_LOCK (task);
if (G_UNLIKELY (GET_TASK_STATE (task) == GST_TASK_STOPPED)) {
g_static_rec_mutex_unlock (lock);
GST_OBJECT_LOCK (task);
- task->abidata.ABI.thread = NULL;
+ task->thread = NULL;
exit:
if (priv->thr_callbacks.leave_thread) {
}
/**
- * gst_task_create:
+ * gst_task_new:
* @func: The #GstTaskFunction to use
* @data: (closure): User data to pass to @func
*
* MT safe.
*/
GstTask *
-gst_task_create (GstTaskFunction func, gpointer data)
+gst_task_new (GstTaskFunction func, gpointer data)
{
GstTask *task;
GST_OBJECT_LOCK (task);
priv->prio_set = TRUE;
priv->priority = priority;
- thread = task->abidata.ABI.thread;
+ thread = task->thread;
if (thread != NULL) {
/* if this task already has a thread, we can configure the priority right
* away, else we do that when we assign a thread to the task. */
/* we don't use a real thread join here because we are using
* thread pools */
GST_OBJECT_LOCK (task);
- if (G_UNLIKELY (tself == task->abidata.ABI.thread))
+ if (G_UNLIKELY (tself == task->thread))
goto joining_self;
SET_TASK_STATE (task, GST_TASK_STOPPED);
/* signal the state change for when it was blocked in PAUSED. */
while (G_LIKELY (task->running))
GST_TASK_WAIT (task);
/* clean the thread */
- task->abidata.ABI.thread = NULL;
+ task->thread = NULL;
/* get the id and pool to join */
pool = priv->pool_id;
id = priv->id;