VLC
3.0.15
|
Data Structures | |
struct | bg_queued_item |
struct | background_worker |
Functions | |
static void * | Thread (void *data) |
static void | BackgroundWorkerCancel (struct background_worker *worker, void *id) |
struct background_worker * | background_worker_New (void *owner, struct background_worker_config *conf) |
Create a background-worker. More... | |
int | background_worker_Push (struct background_worker *worker, void *entity, void *id, int timeout) |
Push an entity into the background-worker. More... | |
void | background_worker_Cancel (struct background_worker *worker, void *id) |
Remove entities from the background-worker. More... | |
void | background_worker_RequestProbe (struct background_worker *worker) |
Request the background-worker to probe the current task. More... | |
void | background_worker_Delete (struct background_worker *worker) |
Delete a background-worker. More... | |
void background_worker_Cancel | ( | struct background_worker * | worker, |
void * | id | ||
) |
Remove entities from the background-worker.
This function is used to remove processing of a certain entity given its associated id, or to remove all queued (including currently running) entities.
id
passed refers to an entity that is currently being processed, the call will block until the task has been terminated.worker | the background-worker |
id | NULL if every entity shall be removed, and the currently running task (if any) shall be cancelled. |
References BackgroundWorkerCancel().
Referenced by playlist_preparser_Cancel(), and playlist_preparser_Deactivate().
void background_worker_Delete | ( | struct background_worker * | worker | ) |
Delete a background-worker.
This function will destroy a background-worker created through background_worker_New. It will effectively stop the currently running task, if any, and empty the queue of pending entities.
worker | the background-worker |
References BackgroundWorkerCancel(), background_worker::data, background_worker::head, background_worker::lock, background_worker::tail, vlc_array_clear(), vlc_cond_destroy(), vlc_mutex_destroy(), background_worker::wait, and background_worker::worker_wait.
Referenced by playlist_fetcher_Delete(), playlist_fetcher_New(), and playlist_preparser_Delete().
struct background_worker* background_worker_New | ( | void * | owner, |
struct background_worker_config * | config | ||
) |
Create a background-worker.
This function creates a new background-worker using the passed configuration.
config
shall have been set by the caller. owner | the owner of the background-worker |
config | the background-worker's configuration |
NULL
on failure. References background_worker::active, background_worker::conf, background_worker::data, background_worker::deadline, background_worker::head, background_worker::id, background_worker::lock, background_worker::owner, background_worker::tail, unlikely, vlc_array_init(), vlc_cond_init(), vlc_mutex_init(), VLC_TS_INVALID, background_worker::wait, and background_worker::worker_wait.
Referenced by playlist_preparser_New(), and WorkerInit().
int background_worker_Push | ( | struct background_worker * | worker, |
void * | entity, | ||
void * | id, | ||
int | timeout | ||
) |
Push an entity into the background-worker.
This function is used to push an entity into the queue of pending work. The entities will be processed in the order in which they are received (in terms of the order of invocations in a single-threaded environment).
worker | the background-worker |
entity | the entity which is to be queued |
id | a value suitable for identifying the entity, or NULL |
timeout | the timeout of the entity in milliseconds, 0 denotes no timeout, a negative value will use the default timeout associated with the background-worker. |
< Unspecified error
< Unspecified error
< No error
< Unspecified error
References background_worker::active, background_worker::conf, background_worker::data, background_worker_config::default_timeout, bg_queued_item::entity, background_worker::head, bg_queued_item::id, background_worker::lock, background_worker_config::pf_hold, background_worker::probe_request, background_worker::tail, Thread(), bg_queued_item::timeout, unlikely, vlc_array_append(), vlc_clone_detach(), vlc_cond_signal(), VLC_EGENERIC, vlc_mutex_lock(), vlc_mutex_unlock(), VLC_SUCCESS, VLC_THREAD_PRIORITY_LOW, and background_worker::wait.
Referenced by playlist_fetcher_Push(), playlist_preparser_Push(), SearchByScope(), and SearchLocal().
void background_worker_RequestProbe | ( | struct background_worker * | worker | ) |
Request the background-worker to probe the current task.
This function is used to signal the background-worker that it should do another probe to see whether the current task is still alive.
worker | the background-worker |
References background_worker::head, background_worker::lock, background_worker::probe_request, vlc_cond_signal(), vlc_mutex_lock(), vlc_mutex_unlock(), and background_worker::worker_wait.
Referenced by FetcherThread(), and InputEvent().
|
static |
References background_worker::active, background_worker::conf, background_worker::data, background_worker::deadline, bg_queued_item::entity, background_worker::head, bg_queued_item::id, background_worker::id, background_worker::lock, background_worker_config::pf_release, background_worker::tail, vlc_array_count(), vlc_array_item_at_index, vlc_array_remove(), vlc_cond_signal(), vlc_cond_wait(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_TS_0, background_worker::wait, and background_worker::worker_wait.
Referenced by background_worker_Cancel(), and background_worker_Delete().
|
static |
References background_worker::active, background_worker::conf, background_worker::data, background_worker::deadline, bg_queued_item::entity, background_worker::head, background_worker::id, bg_queued_item::id, background_worker::lock, mdate(), background_worker::owner, background_worker_config::pf_probe, background_worker_config::pf_release, background_worker_config::pf_start, background_worker_config::pf_stop, background_worker::probe_request, background_worker::tail, bg_queued_item::timeout, vlc_array_count(), vlc_array_item_at_index, vlc_array_remove(), vlc_cond_broadcast(), vlc_cond_timedwait(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_TS_0, background_worker::wait, and background_worker::worker_wait.
Referenced by background_worker_Push().