/**
* SECTION:gsttask
+ * @title: GstTask
* @short_description: Abstraction of GStreamer streaming threads.
* @see_also: #GstElement, #GstPad
*
};
#ifdef _MSC_VER
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
struct _THREADNAME_INFO
__try {
RaiseException (0x406D1388, 0, sizeof (info) / sizeof (DWORD),
- (DWORD *) & info);
+ (const ULONG_PTR *) &info);
}
__except (EXCEPTION_CONTINUE_EXECUTION) {
}
gst_object_unref (klass->pool);
}
klass->pool = gst_task_pool_new ();
+ /* Classes are never destroyed so this ref will never be dropped */
+ GST_OBJECT_FLAG_SET (klass->pool, GST_OBJECT_FLAG_MAY_BE_LEAKED);
gst_task_pool_prepare (klass->pool, NULL);
g_mutex_unlock (&pool_lock);
}
if ((klass = g_type_class_peek (GST_TYPE_TASK))) {
init_klass_pool (klass);
}
+
+ /* GstElement owns a GThreadPool */
+ _priv_gst_element_cleanup ();
}
/**
{
GstTask *task;
+ g_return_val_if_fail (func != NULL, NULL);
+
task = g_object_newv (GST_TYPE_TASK, 0, NULL);
task->func = func;
task->user_data = user_data;
void
gst_task_set_lock (GstTask * task, GRecMutex * mutex)
{
+ g_return_if_fail (GST_IS_TASK (task));
+
GST_OBJECT_LOCK (task);
if (G_UNLIKELY (task->running))
goto is_running;
gpointer id;
GstTaskPool *pool = NULL;
- priv = task->priv;
-
g_return_val_if_fail (GST_IS_TASK (task), FALSE);
+ priv = task->priv;
+
tself = g_thread_self ();
GST_DEBUG_OBJECT (task, "Joining task %p, thread %p", task, tself);