VLC  3.0.15
Data Fields
background_worker_config Struct Reference

Data Fields

mtime_t default_timeout
 Default timeout for completing a task. More...
 
void(* pf_release )(void *entity)
 Release an entity. More...
 
void(* pf_hold )(void *entity)
 Hold a queued item. More...
 
int(* pf_start )(void *owner, void *entity, void **out)
 Start a new task. More...
 
int(* pf_probe )(void *owner, void *handle)
 Probe a running task. More...
 
void(* pf_stop )(void *owner, void *handle)
 Stop a running task. More...
 

Field Documentation

◆ default_timeout

mtime_t background_worker_config::default_timeout

Default timeout for completing a task.

If less-than 0 a task can run indefinitely without being killed, whereas a positive value denotes the maximum number of milliseconds a task can run before pf_stop is called to kill it.

Referenced by background_worker_Push(), playlist_preparser_New(), and WorkerInit().

◆ pf_hold

void( * background_worker_config::pf_hold) (void *entity)

Hold a queued item.

This callback will be called in order to increment the ref-count of an entity. It will happen when the entity is pushed into the queue of pending tasks as part of background_worker_Push.

Parameters
entitythe entity to hold

Referenced by background_worker_Push().

◆ pf_probe

int( * background_worker_config::pf_probe) (void *owner, void *handle)

Probe a running task.

This callback is called in order to see whether or not a running task has finished or not. It can be called anytime between a successful call to pf_start, and the corresponding call to pf_stop.

Parameters
ownerthe owner of the background-worker
handlethe handle associated with the running task
Returns
0 if the task is still running, any other value if finished.

Referenced by Thread().

◆ pf_release

void( * background_worker_config::pf_release) (void *entity)

Release an entity.

This callback will be called in order to decrement the ref-count of a entity within the background-worker. It will happen either when pf_stop has finished executing, or if the entity is removed from the queue (through background_worker_Cancel)

Parameters
entitythe entity to release

Referenced by BackgroundWorkerCancel(), and Thread().

◆ pf_start

int( * background_worker_config::pf_start) (void *owner, void *entity, void **out)

Start a new task.

This callback is called in order to construct a new background task. In order for the background-worker to be able to continue processing incoming requests, pf_start is meant to start a task (such as a thread), and then store the associated handle in *out.

The value of *out will then be the value of the argument named handle in terms of pf_probe and pf_stop.

Parameters
ownerthe owner of the background-worker
entitythe entity for which a task is to be created
out[out] *out shall, on success, refer to the handle associated with the running task.
Returns
VLC_SUCCESS if a task was created, an error-code on failure.

Referenced by Thread().

◆ pf_stop

void( * background_worker_config::pf_stop) (void *owner, void *handle)

Stop a running task.

This callback is called in order to stop a running task. If pf_start has created a non-detached thread, pf_stop is where you would interrupt and then join it.

Warning
This function is called either after pf_probe has stated that the task has finished, or if the timeout (if any) for the task has been reached.
Parameters
ownerthe owner of the background-worker \parma handle the handle associated with the task to be stopped

Referenced by Thread().


The documentation for this struct was generated from the following file: