mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
taskpool: fix docs, make push/join generic
Fix some more docs. Make _push() return a generic id (this can be something else than a GThread in some cases) and make _join() use that generic id.
This commit is contained in:
parent
aadac11ae3
commit
4d326be6cf
3 changed files with 19 additions and 15 deletions
|
@ -2176,8 +2176,8 @@ GstTaskPoolClass
|
|||
gst_task_pool_new
|
||||
gst_task_pool_set_func
|
||||
gst_task_pool_prepare
|
||||
gst_task_pool_join
|
||||
gst_task_pool_push
|
||||
gst_task_pool_join
|
||||
gst_task_pool_cleanup
|
||||
<SUBSECTION Standard>
|
||||
GST_IS_TASK_POOL
|
||||
|
|
|
@ -74,7 +74,7 @@ default_cleanup (GstTaskPool * pool)
|
|||
GST_OBJECT_UNLOCK (pool);
|
||||
}
|
||||
|
||||
static GThread *
|
||||
static gpointer
|
||||
default_push (GstTaskPool * pool, gpointer data, GError ** error)
|
||||
{
|
||||
GST_OBJECT_LOCK (pool);
|
||||
|
@ -86,7 +86,7 @@ default_push (GstTaskPool * pool, gpointer data, GError ** error)
|
|||
}
|
||||
|
||||
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 */
|
||||
}
|
||||
|
@ -203,10 +203,11 @@ gst_task_pool_cleanup (GstTaskPool * pool)
|
|||
*
|
||||
* 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;
|
||||
|
@ -231,12 +232,13 @@ not_supported:
|
|||
/**
|
||||
* 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;
|
||||
|
||||
|
@ -245,5 +247,5 @@ gst_task_pool_join (GstTaskPool * pool, GThread * thread)
|
|||
klass = GST_TASK_POOL_GET_CLASS (pool);
|
||||
|
||||
if (klass->join)
|
||||
klass->join (pool, thread);
|
||||
klass->join (pool, id);
|
||||
}
|
||||
|
|
|
@ -57,7 +57,8 @@ struct _GstTaskPool {
|
|||
|
||||
/**
|
||||
* 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
|
||||
|
@ -67,12 +68,13 @@ struct _GstTaskPool {
|
|||
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];
|
||||
|
@ -87,9 +89,9 @@ void gst_task_pool_set_func (GstTaskPool *pool,
|
|||
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue