GST_OBJECT_UNLOCK (pool);
}
-static GThread *
+static gpointer
default_push (GstTaskPool * pool, gpointer data, GError ** error)
{
GST_OBJECT_LOCK (pool);
}
static void
-default_join (GstTaskPool * pool, GThread * thread)
+default_join (GstTaskPool * pool, gpointer id)
{
/* does nothing, we can't join for threads from the threadpool */
}
*
* Start the execution of a new thread from @pool.
*
- * Returns: a #GThread or NULL when the GThread is not yet known. You must check
- * @error to detect errors.
+ * Returns: a pointer that should be used for the gst_task_pool_join
+ * function. This pointer can be NULL, you must check @error to detect
+ * errors.
*/
-GThread *
+gpointer
gst_task_pool_push (GstTaskPool * pool, gpointer data, GError ** error)
{
GstTaskPoolClass *klass;
/**
* gst_task_pool_join:
* @pool: a #GstTaskPool
- * @thread: a #GThread
+ * @id: the id
*
- * Join a GThread or return it to the pool.
+ * Join a task and/or return it to the pool. @id is the id obtained from
+ * gst_task_pool_push().
*/
void
-gst_task_pool_join (GstTaskPool * pool, GThread * thread)
+gst_task_pool_join (GstTaskPool * pool, gpointer id)
{
GstTaskPoolClass *klass;
klass = GST_TASK_POOL_GET_CLASS (pool);
if (klass->join)
- klass->join (pool, thread);
+ klass->join (pool, id);
}
/**
* GstTaskPoolClass:
- * @init: initialize the threadpool
+ * @parent_class: the parent class structure
+ * @prepare: prepare the threadpool
* @cleanup: make sure all threads are stopped
* @push: start a new thread
* @join: join a thread
struct _GstTaskPoolClass {
GstObjectClass parent_class;
+ /*< public >*/
void (*prepare) (GstTaskPool *pool, GFunc func,
gpointer user_data, GError **error);
void (*cleanup) (GstTaskPool *pool);
- GThread * (*push) (GstTaskPool *pool, gpointer data, GError **error);
- void (*join) (GstTaskPool *pool, GThread *thread);
+ gpointer (*push) (GstTaskPool *pool, gpointer data, GError **error);
+ void (*join) (GstTaskPool *pool, gpointer id);
/*< private >*/
gpointer _gst_reserved[GST_PADDING];
void gst_task_pool_prepare (GstTaskPool *pool, GError **error);
-GThread * gst_task_pool_push (GstTaskPool *pool, gpointer data,
+gpointer gst_task_pool_push (GstTaskPool *pool, gpointer data,
GError **error);
-void gst_task_pool_join (GstTaskPool *pool, GThread *thread);
+void gst_task_pool_join (GstTaskPool *pool, gpointer id);
void gst_task_pool_cleanup (GstTaskPool *pool);