VLC
4.0.0-dev
|
![]() |
Modules | |
Interruptible sleep | |
Files | |
file | vlc_threads.h |
Thread primitive declarations. | |
Data Structures | |
struct | vlc_thread_t |
Thread handle. More... | |
Macros | |
#define | LIBVLC_USE_PTHREAD 1 |
Whether LibVLC threads are based on POSIX threads. More... | |
#define | LIBVLC_USE_PTHREAD_CLEANUP 1 |
Whether LibVLC thread cancellation is based on POSIX threads. More... | |
#define | VLC_THREAD_CANCELED PTHREAD_CANCELED |
Return value of a canceled thread. More... | |
#define | VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER |
Static initializer for (static) mutex. More... | |
#define | VLC_STATIC_COND PTHREAD_COND_INITIALIZER |
Static initializer for (static) condition variable. More... | |
#define | VLC_STATIC_RWLOCK PTHREAD_RWLOCK_INITIALIZER |
Static initializer for (static) read/write lock. More... | |
#define | VLC_STATIC_ONCE PTHREAD_ONCE_INIT |
Static initializer for one-time initialization. More... | |
#define | VLC_THREAD_PRIORITY_LOW 0 |
#define | VLC_THREAD_PRIORITY_INPUT 10 |
#define | VLC_THREAD_PRIORITY_AUDIO 5 |
#define | VLC_THREAD_PRIORITY_VIDEO 0 |
#define | VLC_THREAD_PRIORITY_OUTPUT 15 |
#define | VLC_THREAD_PRIORITY_HIGHEST 20 |
#define | vlc_mutex_assert(m) assert(vlc_mutex_marked(m)) |
Asserts that a mutex is locked by the calling thread. More... | |
#define | VLC_HARD_MIN_SLEEP VLC_TICK_FROM_MS(10) /* 10 milliseconds = 1 tick at 100Hz */ |
#define | VLC_SOFT_MIN_SLEEP VLC_TICK_FROM_SEC(9) /* 9 seconds */ |
#define | check_delay(d) (d) |
#define | check_deadline(d) (d) |
#define | vlc_tick_sleep(d) vlc_tick_sleep(check_delay(d)) |
#define | vlc_tick_wait(d) vlc_tick_wait(check_deadline(d)) |
#define | VLC_TIMER_DISARM (0) |
#define | VLC_TIMER_FIRE_ONCE (0) |
#define | vlc_cleanup_push(routine, arg) pthread_cleanup_push (routine, arg) |
Registers a thread cancellation handler. More... | |
#define | vlc_cleanup_pop() pthread_cleanup_pop (0) |
Unregisters the last cancellation handler. More... | |
#define | mutex_cleanup_push(lock) vlc_cleanup_push (vlc_cleanup_lock, lock) |
#define | vlc_global_lock(n) vlc_global_mutex(n, true) |
Acquires a global mutex. More... | |
#define | vlc_global_unlock(n) vlc_global_mutex(n, false) |
Releases a global mutex. More... | |
Typedefs | |
typedef pthread_mutex_t | vlc_mutex_t |
Mutex. More... | |
typedef pthread_cond_t | vlc_cond_t |
Condition variable. More... | |
typedef sem_t | vlc_sem_t |
Semaphore. More... | |
typedef pthread_rwlock_t | vlc_rwlock_t |
Read/write lock. More... | |
typedef pthread_once_t | vlc_once_t |
One-time initialization. More... | |
typedef pthread_key_t | vlc_threadvar_t |
Thread-local key handle. More... | |
typedef struct vlc_timer * | vlc_timer_t |
Threaded timer handle. More... | |
Enumerations | |
enum | { VLC_CLEANUP_PUSH, VLC_CLEANUP_POP, VLC_CANCEL_ADDR_SET, VLC_CANCEL_ADDR_CLEAR } |
enum | { VLC_AVCODEC_MUTEX = 0, VLC_GCRYPT_MUTEX, VLC_XLIB_MUTEX, VLC_MOSAIC_MUTEX, VLC_MAX_MUTEX } |
Functions | |
void | vlc_testcancel (void) |
Issues an explicit deferred cancellation point. More... | |
void | vlc_mutex_init (vlc_mutex_t *) |
Initializes a fast mutex. More... | |
void | vlc_mutex_init_recursive (vlc_mutex_t *) |
Initializes a recursive mutex. More... | |
void | vlc_mutex_destroy (vlc_mutex_t *) |
Deinitializes a mutex. More... | |
void | vlc_mutex_lock (vlc_mutex_t *) |
Acquires a mutex. More... | |
int | vlc_mutex_trylock (vlc_mutex_t *) |
Tries to acquire a mutex. More... | |
void | vlc_mutex_unlock (vlc_mutex_t *) |
Releases a mutex. More... | |
bool | vlc_mutex_marked (const vlc_mutex_t *) |
Checks if a mutex is locked. More... | |
void | vlc_cond_init (vlc_cond_t *) |
Initializes a condition variable. More... | |
void | vlc_cond_init_daytime (vlc_cond_t *) |
Initializes a condition variable (wall clock). More... | |
void | vlc_cond_destroy (vlc_cond_t *) |
Deinitializes a condition variable. More... | |
void | vlc_cond_signal (vlc_cond_t *) |
Wakes up one thread waiting on a condition variable. More... | |
void | vlc_cond_broadcast (vlc_cond_t *) |
Wakes up all threads waiting on a condition variable. More... | |
void | vlc_cond_wait (vlc_cond_t *cond, vlc_mutex_t *mutex) |
Waits on a condition variable. More... | |
int | vlc_cond_timedwait (vlc_cond_t *cond, vlc_mutex_t *mutex, vlc_tick_t deadline) |
Waits on a condition variable up to a certain date. More... | |
int | vlc_cond_timedwait_daytime (vlc_cond_t *, vlc_mutex_t *, time_t) |
void | vlc_sem_init (vlc_sem_t *, unsigned count) |
Initializes a semaphore. More... | |
void | vlc_sem_destroy (vlc_sem_t *) |
Deinitializes a semaphore. More... | |
int | vlc_sem_post (vlc_sem_t *) |
Increments the value of a semaphore. More... | |
void | vlc_sem_wait (vlc_sem_t *) |
Waits on a semaphore. More... | |
void | vlc_rwlock_init (vlc_rwlock_t *) |
Initializes a read/write lock. More... | |
void | vlc_rwlock_destroy (vlc_rwlock_t *) |
Destroys an initialized unused read/write lock. More... | |
void | vlc_rwlock_rdlock (vlc_rwlock_t *) |
Acquires a read/write lock for reading. More... | |
void | vlc_rwlock_wrlock (vlc_rwlock_t *) |
Acquires a read/write lock for writing. More... | |
void | vlc_rwlock_unlock (vlc_rwlock_t *) |
Releases a read/write lock. More... | |
void | vlc_once (vlc_once_t *restrict once, void(*cb)(void)) |
Executes a function one time. More... | |
int | vlc_threadvar_create (vlc_threadvar_t *key, void(*destr)(void *)) |
Allocates a thread-specific variable. More... | |
void | vlc_threadvar_delete (vlc_threadvar_t *) |
Deallocates a thread-specific variable. More... | |
int | vlc_threadvar_set (vlc_threadvar_t key, void *value) |
Sets a thread-specific variable. More... | |
void * | vlc_threadvar_get (vlc_threadvar_t) |
Gets the value of a thread-local variable for the calling thread. More... | |
void | vlc_addr_wait (void *addr, unsigned val) |
Waits on an address. More... | |
bool | vlc_addr_timedwait (void *addr, unsigned val, vlc_tick_t delay) |
Waits on an address with a time-out. More... | |
void | vlc_addr_signal (void *addr) |
Wakes up one thread on an address. More... | |
void | vlc_addr_broadcast (void *addr) |
Wakes up all thread on an address. More... | |
int | vlc_clone (vlc_thread_t *th, void *(*entry)(void *), void *data, int priority) |
Creates and starts a new thread. More... | |
void | vlc_cancel (vlc_thread_t) |
Marks a thread as cancelled. More... | |
void | vlc_join (vlc_thread_t th, void **result) |
Waits for a thread to complete (if needed), then destroys it. More... | |
int | vlc_savecancel (void) |
Disables thread cancellation. More... | |
void | vlc_restorecancel (int state) |
Restores the cancellation state. More... | |
void | vlc_control_cancel (int cmd,...) |
Internal handler for thread cancellation. More... | |
vlc_thread_t | vlc_thread_self (void) |
Thread handle. More... | |
unsigned long | vlc_thread_id (void) |
Thread identifier. More... | |
vlc_tick_t | vlc_tick_now (void) |
Precision monotonic clock. More... | |
void | vlc_tick_wait (vlc_tick_t deadline) |
Waits until a deadline. More... | |
void | vlc_tick_sleep (vlc_tick_t delay) |
Waits for an interval of time. More... | |
int | vlc_timer_create (vlc_timer_t *id, void(*func)(void *), void *data) |
Initializes an asynchronous timer. More... | |
void | vlc_timer_destroy (vlc_timer_t timer) |
Destroys an initialized timer. More... | |
void | vlc_timer_schedule (vlc_timer_t timer, bool absolute, vlc_tick_t value, vlc_tick_t interval) |
Arms or disarms an initialized timer. More... | |
static void | vlc_timer_disarm (vlc_timer_t timer) |
static void | vlc_timer_schedule_asap (vlc_timer_t timer, vlc_tick_t interval) |
unsigned | vlc_timer_getoverrun (vlc_timer_t) |
Fetches and resets the overrun counter for a timer. More... | |
unsigned | vlc_GetCPUCount (void) |
Count CPUs. More... | |
static void | vlc_cleanup_lock (void *lock) |
static void | vlc_cancel_addr_set (void *addr) |
static void | vlc_cancel_addr_clear (void *addr) |
void | vlc_global_mutex (unsigned, bool) |
Internal handler for global mutexes. More... | |
#define check_deadline | ( | d | ) | (d) |
#define check_delay | ( | d | ) | (d) |
#define LIBVLC_USE_PTHREAD 1 |
Whether LibVLC threads are based on POSIX threads.
#define LIBVLC_USE_PTHREAD_CLEANUP 1 |
Whether LibVLC thread cancellation is based on POSIX threads.
#define mutex_cleanup_push | ( | lock | ) | vlc_cleanup_push (vlc_cleanup_lock, lock) |
Referenced by httpdLoop(), Manage(), RunThread(), TsRun(), vlc_h2_stream_read(), vlc_h2_stream_wait(), vlc_mutex_marked(), vlc_timer_thread(), vout_control_Pop(), and WaitUnused().
#define vlc_cleanup_pop | ( | ) | pthread_cleanup_pop (0) |
Unregisters the last cancellation handler.
This pops the cancellation handler that was last pushed with vlc_cleanup_push() in the calling thread.
Referenced by block_FifoGet(), block_File(), DecoderThread(), detached_thread(), httpdLoop(), joinable_thread(), Manage(), RunThread(), spu_PrerenderThread(), TsRun(), vlc_accept_i11e(), vlc_h2_frame_recv(), vlc_h2_frame_send(), vlc_h2_recv_thread(), vlc_h2_stream_read(), vlc_h2_stream_wait(), vlc_mutex_marked(), vlc_mwait_i11e(), vlc_poll_i11e(), vlc_poll_i11e_inner(), vlc_sem_wait_i11e(), vlc_timer_thread(), vlc_tls_ClientSessionCreate(), vout_control_Pop(), and WaitUnused().
Registers a thread cancellation handler.
This pushes a function to run if the thread is cancelled (or otherwise exits prematurely).
If multiple procedures are registered, they are handled in last-in first-out order.
routine | procedure to call if the thread ends |
arg | argument for the procedure |
Referenced by detached_thread(), joinable_thread(), spu_PrerenderThread(), TsRun(), vlc_accept_i11e(), vlc_h2_frame_recv(), vlc_h2_frame_send(), vlc_h2_recv_thread(), vlc_mutex_marked(), vlc_mwait_i11e(), vlc_poll_i11e(), vlc_poll_i11e_inner(), vlc_sem_wait_i11e(), and vlc_tls_ClientSessionCreate().
#define vlc_global_lock | ( | n | ) | vlc_global_mutex(n, true) |
Acquires a global mutex.
Referenced by vlc_avcodec_lock(), vlc_gcrypt_init(), vlc_mta_acquire(), vlc_mta_release(), and vlc_xlib_init().
#define vlc_global_unlock | ( | n | ) | vlc_global_mutex(n, false) |
Releases a global mutex.
Referenced by vlc_avcodec_unlock(), vlc_gcrypt_init(), vlc_mta_acquire(), vlc_mta_release(), and vlc_xlib_init().
#define VLC_HARD_MIN_SLEEP VLC_TICK_FROM_MS(10) /* 10 milliseconds = 1 tick at 100Hz */ |
#define vlc_mutex_assert | ( | m | ) | assert(vlc_mutex_marked(m)) |
Asserts that a mutex is locked by the calling thread.
Referenced by aout_GainNotify(), BackgroundWorkerCancelLocked(), DecoderUpdateFormatLocked(), DecoderWaitUnblock(), input_item_GetMetaLocked(), InputItemFindCat(), InputItemVaAddInfo(), module_EndBank(), QueuePush(), QueueRemoveAll(), QueueTake(), SpawnThread(), TsPopCmdLocked(), UpdateSPU(), vlc_fifo_DequeueAllUnlocked(), vlc_fifo_DequeueUnlocked(), vlc_fifo_GetBytes(), vlc_fifo_GetCount(), vlc_fifo_QueueUnlocked(), vlc_media_source_provider_Add(), vlc_media_source_provider_Find(), vlc_media_tree_AssertLocked(), vlc_ml_event_unregister_from_callback(), vlc_player_assert_locked(), vlc_plugin_store(), vout_UpdateWindowSizeLocked(), vout_window_UpdateInhibitionUnlocked(), and VoutVideoFilterStaticNewPicture().
#define VLC_SOFT_MIN_SLEEP VLC_TICK_FROM_SEC(9) /* 9 seconds */ |
#define VLC_STATIC_COND PTHREAD_COND_INITIALIZER |
Static initializer for (static) condition variable.
#define VLC_STATIC_MUTEX PTHREAD_MUTEX_INITIALIZER |
Static initializer for (static) mutex.
Referenced by config_SaveConfigFile(), module_InitStaticModules(), vlc_global_mutex(), and vlc_threads_setup().
#define VLC_STATIC_ONCE PTHREAD_ONCE_INIT |
Static initializer for one-time initialization.
Referenced by vlc_CPU().
#define VLC_STATIC_RWLOCK PTHREAD_RWLOCK_INITIALIZER |
Static initializer for (static) read/write lock.
#define VLC_THREAD_CANCELED PTHREAD_CANCELED |
Return value of a canceled thread.
#define VLC_THREAD_PRIORITY_AUDIO 5 |
Referenced by decoder_New().
#define VLC_THREAD_PRIORITY_HIGHEST 20 |
#define VLC_THREAD_PRIORITY_INPUT 10 |
Referenced by input_Start(), TsStart(), vlc_demux_chained_New(), vlc_h2_conn_create(), vlc_h2_output_create(), and vlc_timer_create().
#define VLC_THREAD_PRIORITY_LOW 0 |
#define VLC_THREAD_PRIORITY_OUTPUT 15 |
Referenced by vout_Request().
#define VLC_THREAD_PRIORITY_VIDEO 0 |
Referenced by decoder_New(), and spu_Create().
#define vlc_tick_sleep | ( | d | ) | vlc_tick_sleep(check_delay(d)) |
Referenced by aout_Drain(), EsOutDrainDecoder(), ModuleThread_NewSpuBuffer(), and vlc_mutex_marked().
#define vlc_tick_wait | ( | d | ) | vlc_tick_wait(check_deadline(d)) |
Referenced by TsRun(), vlc_mutex_marked(), and vlc_mwait_i11e().
#define VLC_TIMER_DISARM (0) |
Referenced by vlc_timer_disarm(), and vlc_timer_schedule().
#define VLC_TIMER_FIRE_ONCE (0) |
typedef pthread_cond_t vlc_cond_t |
Condition variable.
Storage space for a thread condition variable.
typedef pthread_mutex_t vlc_mutex_t |
Mutex.
Storage space for a mutual exclusion lock.
typedef pthread_once_t vlc_once_t |
One-time initialization.
A one-time initialization object must always be initialized assigned to VLC_STATIC_ONCE before use.
typedef pthread_rwlock_t vlc_rwlock_t |
Read/write lock.
Storage space for a slim reader/writer lock.
typedef sem_t vlc_sem_t |
Semaphore.
Storage space for a thread-safe semaphore.
typedef pthread_key_t vlc_threadvar_t |
Thread-local key handle.
typedef struct vlc_timer* vlc_timer_t |
Threaded timer handle.
anonymous enum |
void vlc_addr_broadcast | ( | void * | addr | ) |
Wakes up all thread on an address.
Wakes up all threads sleeping on the specified address (if any). Any thread sleeping within a call to vlc_addr_wait() or vlc_addr_timedwait() with the specified address as first call parameter will be woken up.
addr | address identifying which threads to wake up |
References vlc_futex_wake().
Referenced by vlc_cancel(), and vlc_mutex_marked().
void vlc_addr_signal | ( | void * | addr | ) |
Wakes up one thread on an address.
Wakes up (at least) one of the thread sleeping on the specified address. The address must be equal to the first parameter given by at least one thread sleeping within the vlc_addr_wait() or vlc_addr_timedwait() functions. If no threads are found, this function does nothing.
addr | address identifying which threads may be woken up |
References vlc_futex_wake().
Referenced by vlc_mutex_marked().
bool vlc_addr_timedwait | ( | void * | addr, |
unsigned | val, | ||
vlc_tick_t | delay | ||
) |
Waits on an address with a time-out.
This function operates as vlc_addr_wait() but provides an additional time-out. If the time-out elapses, the thread resumes and the function returns.
addr | address to check for |
val | value to match at the address |
delay | time-out duration |
References timespec_from_vlc_tick(), and vlc_futex_wait().
Referenced by vlc_mutex_marked().
void vlc_addr_wait | ( | void * | addr, |
unsigned | val | ||
) |
Waits on an address.
Puts the calling thread to sleep if a specific value is stored at a specified address. The thread will sleep until it is woken up by a call to vlc_addr_signal() or vlc_addr_broadcast() in another thread, or spuriously.
If the value does not match, do nothing and return immediately.
addr | address to check for |
val | value to match at the address |
References vlc_futex_wait().
Referenced by vlc_mutex_marked().
void vlc_cancel | ( | vlc_thread_t | ) |
Marks a thread as cancelled.
Next time the target thread reaches a cancellation point (while not having disabled cancellation), it will run its cancellation cleanup handler, the thread variable destructors, and terminate.
vlc_join() must be used regardless of a thread being cancelled or not, to avoid leaking resources.
References vlc_thread::addr, vlc_thread_t::handle, vlc_addr_broadcast(), vlc_cancel_self(), vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by AddressDestroy(), httpd_HostDelete(), input_DecoderDelete(), spu_Destroy(), TsStop(), vlc_getaddrinfo_i11e(), vlc_h2_conn_destroy(), vlc_h2_output_destroy(), vlc_timer_destroy(), vlm_Delete(), and vout_StopDisplay().
|
inlinestatic |
References lock, VLC_CANCEL_ADDR_CLEAR, vlc_control_cancel(), vlc_mutex_lock(), and vlc_mutex_unlock().
Referenced by vlc_mutex_marked().
|
inlinestatic |
References VLC_CANCEL_ADDR_SET, and vlc_control_cancel().
Referenced by vlc_mutex_marked().
|
inlinestatic |
References vlc_mutex_unlock().
int vlc_clone | ( | vlc_thread_t * | th, |
void *(*)(void *) | entry, | ||
void * | data, | ||
int | priority | ||
) |
Creates and starts a new thread.
The thread must be joined with vlc_join() to reclaim resources when it is not needed anymore.
th | storage space for the handle of the new thread (cannot be NULL) [OUT] |
entry | entry point for the thread |
data | data parameter given to the entry point |
priority | thread priority value |
References vlc_clone_attr().
Referenced by addons_manager_Gather(), AddressCreate(), decoder_New(), httpd_HostCreate(), input_Start(), InstallEntry(), spu_Create(), StartWorker(), TsStart(), update_Check(), update_Download(), vlc_demux_chained_New(), vlc_getaddrinfo_i11e(), vlc_h2_conn_create(), vlc_h2_output_create(), vlc_mta_acquire(), vlc_player_New(), vlc_timer_create(), vlm_New(), and vout_Request().
void vlc_cond_broadcast | ( | vlc_cond_t * | ) |
Wakes up all threads waiting on a condition variable.
References vlc_cond_signal(), and vlc_static_cond_init().
Referenced by background_worker_Delete(), picture_pool_Cancel(), TriggerCallback(), TriggerListCallback(), vlc_clock_main_Abort(), vlc_clock_main_ChangePause(), vlc_clock_main_reset(), vlc_clock_master_set_delay(), vlc_clock_master_update(), vlc_clock_slave_set_delay(), vlc_h2_stream_end(), vlc_h2_stream_reset(), vlc_mutex_marked(), vlc_mutex_unlock(), vout_snapshot_End(), and vout_snapshot_Set().
void vlc_cond_destroy | ( | vlc_cond_t * | ) |
Deinitializes a condition variable.
No threads shall be waiting or signaling the condition, otherwise the behavior is undefined.
References VLC_THREAD_ASSERT.
Referenced by _DLL_InitTerm(), AddressDestroy(), background_thread_Destroy(), background_worker_Destroy(), block_FifoRelease(), DeleteDecoder(), Destroy(), dialog_id_release(), httpd_HostCreate(), httpd_HostDelete(), picture_pool_Destroy(), spu_Cleanup(), TsDestroy(), vlc_clock_main_Delete(), vlc_h2_output_create(), vlc_h2_output_destroy(), vlc_h2_stream_close(), vlc_h2_stream_open(), vlc_mutex_marked(), vlc_mwait_i11e(), vlc_mwait_i11e_cleanup(), vlc_object_deinit(), vlc_player_DestroyLocks(), vlc_static_cond_destroy_all(), vlc_timer_create(), vlc_timer_destroy(), vlm_Delete(), vlm_New(), vout_control_Clean(), and vout_snapshot_Destroy().
void vlc_cond_init | ( | vlc_cond_t * | ) |
Initializes a condition variable.
References unlikely.
Referenced by _DLL_InitTerm(), AddressCreate(), background_thread_Create(), background_worker_Create(), block_FifoNew(), Create(), CreateDecoder(), dialog_add_locked(), httpd_HostCreate(), picture_pool_NewExtended(), spu_Create(), TsStart(), vlc_clock_main_New(), vlc_cond_init_daytime(), vlc_h2_output_create(), vlc_h2_stream_open(), vlc_mutex_marked(), vlc_mwait_i11e(), vlc_object_init(), vlc_player_InitLocks(), vlc_static_cond_init(), vlc_timer_create(), vout_control_Init(), and vout_snapshot_New().
void vlc_cond_init_daytime | ( | vlc_cond_t * | ) |
Initializes a condition variable (wall clock).
This function initializes a condition variable for timed waiting using the UTC wall clock time. The time reference is the same as with time() and with timespec_get() and TIME_UTC. vlc_cond_timedwait_daytime() must be instead of vlc_cond_timedwait() for actual waiting.
References unlikely, and vlc_cond_init().
Referenced by vlc_mutex_marked(), and vlm_New().
void vlc_cond_signal | ( | vlc_cond_t * | ) |
Wakes up one thread waiting on a condition variable.
If any thread is currently waiting on the condition variable, at least one of those threads will be woken up. Otherwise, this function has no effects.
References vlc_static_cond_init(), and VLC_THREAD_ASSERT.
Referenced by addons_manager_Gather(), background_worker_RequestProbe(), BackgroundWorkerCancelLocked(), DecoderThread(), DecoderUpdatePreroll(), dialog_id_post(), dialog_wait_interrupted(), finder_thread_interrupted(), httpd_UrlNew(), input_ControlPush(), input_DecoderDelete(), input_DecoderStartWait(), input_DecoderStopWait(), input_Stop(), InstallEntry(), installer_thread_interrupted(), ModuleThread_PlayAudio(), ModuleThread_PlaySpu(), ModuleThread_PlayVideo(), picture_pool_ReleasePicture(), picture_pool_Wait(), player_on_state_changed(), QueuePush(), RemoveThread(), sout_AnnounceRegisterSDP(), sout_AnnounceUnRegister(), spu_PrerenderEnqueue(), spu_PrerenderThread(), spu_PrerenderWake(), TsChangePause(), TsPushCmd(), vlc_cond_broadcast(), vlc_fifo_Signal(), vlc_h2_output_destroy(), vlc_h2_output_queue(), vlc_h2_stream_data(), vlc_h2_stream_headers(), vlc_h2_stream_wake_up(), vlc_mutex_marked(), vlc_mwait_i11e_wake(), vlc_player_CancelWaitError(), vlc_player_Delete(), vlc_player_destructor_AddInput(), vlc_player_destructor_AddStoppingInput(), vlc_timer_schedule(), vout_control_Pop(), vout_control_Push(), vout_control_Release(), and vout_control_Wake().
int vlc_cond_timedwait | ( | vlc_cond_t * | cond, |
vlc_mutex_t * | mutex, | ||
vlc_tick_t | deadline | ||
) |
Waits on a condition variable up to a certain date.
This works like vlc_cond_wait() but with an additional time-out. The time-out is expressed as an absolute timestamp using the same arbitrary time reference as the vlc_tick_now() and vlc_tick_wait() functions.
cond | condition variable to wait on |
mutex | mutex which is unlocked while waiting, then locked again when waking up |
deadline | absolute timeout |
References timespec_from_vlc_tick(), vlc_cond_wait_common(), VLC_THREAD_ASSERT, and vlc_tick_now().
Referenced by ControlPop(), QueueTake(), RunThread(), Thread(), vlc_clock_Wait(), vlc_fifo_TimedWaitCond(), vlc_mutex_marked(), vlc_mwait_i11e(), vlc_player_WaitRetryDelay(), vlc_timer_thread(), vout_control_Pop(), and vout_snapshot_Get().
int vlc_cond_timedwait_daytime | ( | vlc_cond_t * | , |
vlc_mutex_t * | , | ||
time_t | |||
) |
References gettimeofday(), vlc_cond_wait_common(), VLC_THREAD_ASSERT, and vlc_tick_from_timeval.
Referenced by Manage(), and vlc_mutex_marked().
void vlc_cond_wait | ( | vlc_cond_t * | cond, |
vlc_mutex_t * | mutex | ||
) |
Waits on a condition variable.
The calling thread will be suspended until another thread calls vlc_cond_signal() or vlc_cond_broadcast() on the same condition variable, the thread is cancelled with vlc_cancel(), or the system causes a spurious unsolicited wake-up.
A mutex is needed to wait on a condition variable. It must not be a recursive mutex. Although it is possible to use the same mutex for multiple condition, it is not valid to use different mutexes for the same condition variable at the same time from different threads.
The canonical way to use a condition variable to wait for event foobar is:
cond | condition variable to wait on |
mutex | mutex which is unlocked while waiting, then locked again when waking up. |
References vlc_cond_wait_common(), vlc_static_cond_init(), and VLC_THREAD_ASSERT.
Referenced by background_worker_Delete(), ControlPop(), DecoderWaitUnblock(), dialog_wait(), FinderThread(), httpdLoop(), input_DecoderWait(), InstallerThread(), Manage(), picture_pool_Wait(), RunThread(), spu_PrerenderCancel(), spu_PrerenderPause(), spu_PrerenderSync(), spu_PrerenderThread(), TsRun(), vlc_fifo_WaitCond(), vlc_h2_output_dequeue(), vlc_h2_stream_read(), vlc_h2_stream_wait(), vlc_mutex_lock(), vlc_mutex_marked(), vlc_player_CondWait(), vlc_player_destructor_Thread(), vlc_timer_thread(), vout_control_Hold(), vout_control_Pop(), and WaitUnused().
void vlc_control_cancel | ( | int | cmd, |
... | |||
) |
Internal handler for thread cancellation.
Do not call this function directly. Use wrapper macros instead: vlc_cleanup_push(), vlc_cleanup_pop().
References vlc_thread::addr, vlc_thread::cleaners, vlc_thread::lock, vlc_assert_unreachable, VLC_CANCEL_ADDR_CLEAR, VLC_CANCEL_ADDR_SET, VLC_CLEANUP_POP, VLC_CLEANUP_PUSH, vlc_mutex_lock(), vlc_mutex_unlock(), vlc_thread_self(), and vlc_thread::wait.
Referenced by vlc_cancel_addr_clear(), and vlc_cancel_addr_set().
unsigned vlc_GetCPUCount | ( | void | ) |
Count CPUs.
References count, unlikely, and vlc_alloc().
Referenced by vlc_timer_schedule_asap().
void vlc_global_mutex | ( | unsigned | , |
bool | |||
) |
Internal handler for global mutexes.
Do not use this function directly. Use helper macros instead: vlc_global_lock(), vlc_global_unlock().
References lock, static_assert, VLC_MAX_MUTEX, vlc_mutex_lock(), vlc_mutex_unlock(), and VLC_STATIC_MUTEX.
void vlc_join | ( | vlc_thread_t | th, |
void ** | result | ||
) |
Waits for a thread to complete (if needed), then destroys it.
th | thread handle |
result | [OUT] pointer to write the thread return value or NULL |
References clean_detached_thread(), vlc_thread_t::handle, vlc_sem_destroy(), vlc_sem_wait(), vlc_testcancel(), VLC_THREAD_ASSERT, vlc_thread_destroy(), and vlc_WaitForSingleObject().
Referenced by addons_manager_Delete(), AddressDestroy(), CloseWorker(), httpd_HostDelete(), input_Close(), input_DecoderDelete(), spu_Destroy(), TsStop(), update_Check(), update_Delete(), update_Download(), vlc_demux_chained_Delete(), vlc_getaddrinfo_i11e(), vlc_h2_conn_destroy(), vlc_h2_output_destroy(), vlc_mta_release(), vlc_player_Delete(), vlc_timer_destroy(), vlm_Delete(), and vout_StopDisplay().
void vlc_mutex_destroy | ( | vlc_mutex_t * | ) |
Deinitializes a mutex.
The mutex must not be locked, otherwise behaviour is undefined.
References VLC_THREAD_ASSERT.
Referenced by _DLL_InitTerm(), addon_entry_Release(), AddressDestroy(), aout_Release(), background_worker_Destroy(), block_FifoRelease(), clean_detached_thread(), DeleteDecoder(), Destroy(), dialog_id_release(), EsOutDelete(), httpd_HostCreate(), httpd_HostDelete(), httpd_StreamDelete(), httpd_UrlDelete(), input_clock_Delete(), input_fetcher_Delete(), input_item_Release(), input_resource_Release(), input_stats_Destroy(), libvlc_InternalDestroy(), libvlc_InternalDialogClean(), libvlc_MlCreate(), libvlc_MlRelease(), picture_fifo_Delete(), picture_pool_Destroy(), sout_DeleteInstance(), sout_NewInstance(), spu_Cleanup(), thumbnailer_request_Release(), TsDestroy(), update_Delete(), vlc_clock_main_Delete(), vlc_demux_chained_Delete(), vlc_demux_chained_New(), vlc_event_manager_fini(), vlc_ExitDestroy(), vlc_gl_surface_Create(), vlc_gl_surface_Destroy(), vlc_h2_conn_create(), vlc_h2_conn_destroy(), vlc_h2_output_create(), vlc_h2_output_destroy(), vlc_http_cookies_destroy(), vlc_interrupt_deinit(), vlc_LogEarlyClose(), vlc_media_source_provider_Delete(), vlc_media_tree_Delete(), vlc_mutex_marked(), vlc_object_deinit(), vlc_player_DestroyLocks(), vlc_player_DestroyTimer(), vlc_timer_create(), vlc_timer_destroy(), vlm_Delete(), vlm_New(), vout_control_Clean(), vout_Release(), vout_snapshot_Destroy(), vout_window_Delete(), and vout_window_New().
void vlc_mutex_init | ( | vlc_mutex_t * | ) |
Initializes a fast mutex.
Recursive locking of a fast mutex is undefined behaviour. (In debug builds, recursive locking will cause an assertion failure.)
References unlikely.
Referenced by _DLL_InitTerm(), addon_entry_New(), AddressCreate(), aout_New(), background_worker_Create(), block_FifoNew(), Create(), CreateDecoder(), dialog_add_locked(), httpd_HostCreate(), httpd_StreamNew(), httpd_UrlNew(), input_clock_New(), input_EsOutNew(), input_fetcher_New(), input_item_NewExt(), input_rate_Init(), input_resource_New(), libvlc_InternalCreate(), libvlc_InternalDialogInit(), libvlc_MlCreate(), picture_fifo_New(), picture_pool_NewExtended(), sout_NewInstance(), spu_Create(), thumbnailer_RequestCommon(), TsStart(), update_New(), vlc_clock_main_New(), vlc_clone_attr(), vlc_demux_chained_New(), vlc_ExitInit(), vlc_gl_surface_Create(), vlc_h2_conn_create(), vlc_h2_output_create(), vlc_http_cookies_new(), vlc_interrupt_init(), vlc_LogEarlyOpen(), vlc_media_source_provider_New(), vlc_media_tree_New(), vlc_mutex_marked(), vlc_object_init(), vlc_player_InitLocks(), vlc_player_InitTimer(), vlc_timer_create(), vlm_New(), vout_control_Init(), vout_Create(), vout_snapshot_New(), and vout_window_New().
void vlc_mutex_init_recursive | ( | vlc_mutex_t * | ) |
Initializes a recursive mutex.
References unlikely.
Referenced by input_EsOutTimeshiftNew(), vlc_event_manager_init(), and vlc_player_InitLocks().
void vlc_mutex_lock | ( | vlc_mutex_t * | ) |
Acquires a mutex.
If needed, this waits for any other thread to release it.
References super_mutex, super_variable, vlc_cond_wait(), vlc_mutex_lock(), vlc_mutex_mark(), vlc_mutex_unlock(), vlc_restorecancel(), vlc_savecancel(), and VLC_THREAD_ASSERT.
Referenced by Add(), AddAlbumCache(), addons_manager_Delete(), addons_manager_Gather(), addons_manager_WriteCatalog(), aout_ChangeViewpoint(), aout_DecPlay(), aout_Destroy(), aout_DeviceSet(), aout_DevicesList(), aout_HotplugNotify(), aout_MuteSet(), aout_OutputDelete(), aout_OutputNew(), aout_VolumeSet(), ArtCachePath(), background_worker_Cancel(), background_worker_Delete(), background_worker_Push(), background_worker_RequestProbe(), block_FifoCount(), block_FifoShow(), block_FifoSize(), CheckArt(), CheckMeta(), config_SaveConfigFile(), Control(), ControlPop(), Create(), CreateCacheKey(), CreateVoutIfNeeded(), DecoderPlayCc(), DecoderThread(), DecoderThread_AbortPictures(), DecoderThread_ChangeDelay(), DecoderThread_ChangePause(), DecoderThread_ChangeRate(), DecoderThread_Flush(), DecoderThread_ProcessInput(), DecoderUpdatePreroll(), Del(), DestroyVout(), dialog_cancel_locked(), dialog_display_error_va(), dialog_display_login_va(), dialog_display_question_va(), dialog_id_post(), dialog_remove_locked(), dialog_update_progress(), dialog_wait(), dialog_wait_interrupted(), display_progress_va(), End(), EsOutAdd(), EsOutControl(), EsOutDel(), EsOutFillEsFmt(), EsOutMeta(), EsOutProgramEpg(), EsOutSend(), finder_thread_interrupted(), FinderThread(), getHeldEntryByUUID(), httpd_HostCreate(), httpd_HostDelete(), httpd_StreamCallBack(), httpd_StreamHeader(), httpd_StreamSend(), httpd_StreamSetHTTPHeaders(), httpd_UrlCatch(), httpd_UrlDelete(), httpd_UrlNew(), httpdLoop(), InitTitle(), input_clock_ChangePause(), input_clock_ChangeRate(), input_clock_ChangeSystemOrigin(), input_clock_ConvertTS(), input_clock_GetJitter(), input_clock_GetRate(), input_clock_GetState(), input_clock_GetSystemOrigin(), input_clock_GetWakeup(), input_clock_Reset(), input_clock_SetJitter(), input_clock_Update(), input_ControlPush(), input_DecoderAddVoutOverlay(), input_DecoderDelete(), input_DecoderDelVoutOverlay(), input_DecoderFrameNext(), input_DecoderGetCcDesc(), input_DecoderGetCcState(), input_DecoderHasFormatChanged(), input_DecoderIsEmpty(), input_DecoderSetCcState(), input_DecoderSetSpuHighlight(), input_DecoderSetVoutMouseEvent(), input_DecoderStartWait(), input_DecoderStopWait(), input_DecoderWait(), input_GetAttachment(), input_GetAttachments(), input_item_AddInfo(), input_item_AddOpaque(), input_item_AddOption(), input_item_AddSlave(), input_item_ApplyOptions(), input_item_ChangeEPGSource(), input_item_Copy(), input_item_CopyOptions(), input_item_DelInfo(), input_item_GetDuration(), input_item_GetInfo(), input_item_GetMeta(), input_item_GetName(), input_item_GetTitleFbName(), input_item_GetURI(), input_item_HasErrorWhenReading(), input_item_IsArtFetched(), input_item_IsPreparsed(), input_item_MergeInfos(), input_item_MetaMatch(), input_item_node_AppendItem(), input_item_ReplaceInfos(), input_item_SetArtFetched(), input_item_SetArtNotFound(), input_item_SetDuration(), input_item_SetEpg(), input_item_SetEpgEvent(), input_item_SetEpgOffline(), input_item_SetEpgTime(), input_item_SetErrorWhenReading(), input_item_SetMeta(), input_item_SetName(), input_item_SetPreparsed(), input_item_SetURI(), input_item_ShouldPreparseSubItems(), input_item_UpdateTracksInfo(), input_item_WriteMeta(), input_preparser_Push(), input_rate_Add(), input_resource_GetAout(), input_resource_GetVoutDecoderDevice(), input_resource_HoldAout(), input_resource_HoldVout(), input_resource_HoldVouts(), input_resource_PutAout(), input_resource_PutVout(), input_resource_PutVoutLocked(), input_resource_RequestSout(), input_resource_SetInput(), input_resource_StartVout(), input_resource_StopFreeVout(), input_stats_Compute(), input_Stop(), input_Stopped(), input_thread_Events(), InputSourceMeta(), InputSourceNew(), InputUpdateMeta(), InstallEntry(), installer_thread_interrupted(), InstallerThread(), installOrRemoveAddon(), intf_Create(), intf_DestroyAll(), libvlc_GetMainPlaylist(), libvlc_InternalDialogClean(), libvlc_MetadataRequest(), libvlc_Quit(), libvlc_SetExitHandler(), LoadSlaves(), Lookup(), MainLoopStatistics(), Manage(), MergeSources(), module_EndBank(), module_InitBank(), module_InitStaticModules(), ModuleThread_GetDecoderDevice(), ModuleThread_GetDisplayDate(), ModuleThread_GetDisplayRate(), ModuleThread_NewSpuBuffer(), ModuleThread_PlayAudio(), ModuleThread_PlaySpu(), ModuleThread_PlayVideo(), ModuleThread_QueueSpu(), ModuleThread_QueueThumbnail(), ModuleThread_UpdateAudioFormat(), MouseEvent(), on_thumbnailer_input_event(), picture_fifo_Flush(), picture_fifo_OffsetDate(), picture_fifo_Peek(), picture_fifo_Pop(), picture_fifo_Push(), picture_pool_Cancel(), picture_pool_Get(), picture_pool_ReleasePicture(), picture_pool_Wait(), player_on_state_changed(), ReadAlbumCache(), RemoveThread(), RunThread(), Send(), sout_AnnounceRegisterSDP(), sout_AnnounceUnRegister(), sout_InputControlVa(), sout_InputDelete(), sout_InputFlush(), sout_InputIsEmpty(), sout_InputNew(), sout_InputSendBuffer(), spu_Attach(), spu_ChangeChannelOrderMargin(), spu_ChangeFilters(), spu_ChangeSources(), spu_ClearChannel(), spu_Detach(), spu_PrerenderCancel(), spu_PrerenderEnqueue(), spu_PrerenderPause(), spu_PrerenderSync(), spu_PrerenderThread(), spu_PrerenderWake(), spu_PutSubpicture(), spu_RegisterChannelInternal(), spu_Render(), spu_SetClockDelay(), spu_SetClockRate(), spu_SetHighlight(), spu_UnregisterChannel(), SpuRenderText(), StereoModeCallback(), TerminateTask(), Thread(), ThreadChangeFilters(), ThreadControl(), ThreadDisplayPreparePicture(), ThreadDisplayRenderPicture(), ThreadFilterFlush(), ThreadProcessMouseState(), thumbnailer_buffer_new(), thumbnailer_request_Probe(), thumbnailer_request_Stop(), TriggerCallback(), TriggerListCallback(), TsChangePause(), TsChangeRate(), TsHasCmd(), TsIsUnused(), TsPushCmd(), TsRun(), TsStop(), update_CheckReal(), var_Create(), var_GetAllNames(), vlc_cancel(), vlc_cancel_addr_clear(), vlc_clock_ConvertArrayToSystem(), vlc_clock_ConvertToSystem(), vlc_clock_Delete(), vlc_clock_main_Abort(), vlc_clock_main_ChangePause(), vlc_clock_main_CreateMaster(), vlc_clock_main_CreateSlave(), vlc_clock_main_Reset(), vlc_clock_main_SetFirstPcr(), vlc_clock_main_SetInputDejitter(), vlc_clock_main_SetMaster(), vlc_clock_master_reset(), vlc_clock_master_set_dejitter(), vlc_clock_master_set_delay(), vlc_clock_master_update(), vlc_clock_slave_reset(), vlc_clock_slave_set_delay(), vlc_clock_slave_update(), vlc_clock_Wait(), vlc_cond_wait_common(), vlc_control_cancel(), vlc_demux_chained_ControlVa(), vlc_demux_chained_Thread(), vlc_dialog_id_get_context(), vlc_dialog_id_set_context(), vlc_dialog_is_cancelled(), vlc_dialog_provider_set_callbacks(), vlc_dialog_provider_set_ext_callback(), vlc_dialog_release(), vlc_drand48(), vlc_event_attach(), vlc_event_detach(), vlc_event_send(), vlc_ext_dialog_update(), vlc_fifo_Lock(), vlc_gl_surface_CheckSize(), vlc_gl_surface_Create(), vlc_gl_surface_ResizeNotify(), vlc_global_mutex(), vlc_h2_client_output_thread(), vlc_h2_conn_release(), vlc_h2_output_dequeue(), vlc_h2_output_destroy(), vlc_h2_output_queue(), vlc_h2_output_thread(), vlc_h2_recv_thread(), vlc_h2_stream_close(), vlc_h2_stream_lock(), vlc_h2_stream_open(), vlc_h2_stream_wake_up(), vlc_http_cookies_fetch(), vlc_http_cookies_store(), vlc_interrupt_finish(), vlc_interrupt_prepare(), vlc_interrupt_raise(), vlc_lrand48(), vlc_media_source_provider_GetMediaSource(), vlc_media_source_provider_Remove(), vlc_media_tree_Lock(), vlc_ml_event_register_callback(), vlc_ml_event_send(), vlc_ml_event_unregister_callback(), vlc_mrand48(), vlc_mutex_lock(), vlc_mutex_marked(), vlc_mutex_trylock(), vlc_mutex_unlock(), vlc_mwait_i11e(), vlc_once(), vlc_player_AddSmpteTimer(), vlc_player_AddTimer(), vlc_player_aout_AddListener(), vlc_player_aout_RemoveListener(), vlc_player_Delete(), vlc_player_destructor_Thread(), vlc_player_GetTimerPoint(), vlc_player_Lock(), vlc_player_RemoveTimer(), vlc_player_RemoveTimerSource(), vlc_player_ResetTimer(), vlc_player_UpdateTimer(), vlc_player_UpdateTimerState(), vlc_player_vout_AddListener(), vlc_player_vout_RemoveListener(), vlc_playlist_item_meta_New(), vlc_static_cond_init(), vlc_strfplayer(), vlc_thread_cleanup(), vlc_threads_setup(), vlc_threadvar_create(), vlc_threadvar_delete(), vlc_thumbnailer_Cancel(), vlc_timer_schedule(), vlc_timer_thread(), vlc_vaLogEarly(), vlm_Control(), vlm_Delete(), vlm_ExecuteCommand(), vlm_MediaVodControl(), vlm_New(), vout_ChangeCropBorder(), vout_ChangeCropRatio(), vout_ChangeCropWindow(), vout_ChangeDisplayAspectRatio(), vout_ChangeDisplayFilled(), vout_ChangeDisplaySize(), vout_ChangeFullscreen(), vout_ChangePause(), vout_ChangeViewpoint(), vout_ChangeWindowed(), vout_ChangeWindowState(), vout_ChangeZoom(), vout_control_Dead(), vout_control_Hold(), vout_control_Pop(), vout_control_Push(), vout_control_Release(), vout_control_Wake(), vout_DisableWindow(), vout_EnableWindow(), vout_FlushUnlocked(), vout_OSDEpg(), vout_ReleaseDisplay(), vout_snapshot_End(), vout_snapshot_Get(), vout_snapshot_Set(), vout_Start(), vout_UpdateWindowSizeLocked(), vout_window_Delete(), vout_window_New(), vout_window_ReportFullscreen(), vout_window_ReportWindowed(), and vout_window_SetInhibition().
bool vlc_mutex_marked | ( | const vlc_mutex_t * | ) |
Checks if a mutex is locked.
Do not use this function directly. Use vlc_mutex_assert() instead.
false | in debug builds of LibVLC, if the mutex is not locked by the calling thread; |
true | in debug builds of LibVLC, if the mutex is locked by the calling thread; |
true | in release builds of LibVLC. |
References likely, lock, mutex_cleanup_push, static_assert, TIME_UTC, timespec_get(), unlikely, vlc_addr_broadcast(), vlc_addr_signal(), vlc_addr_timedwait(), vlc_addr_wait(), vlc_cancel_addr_clear(), vlc_cancel_addr_set(), vlc_cleanup_pop, vlc_cleanup_push, vlc_cond_broadcast(), vlc_cond_destroy(), vlc_cond_init(), vlc_cond_init_daytime(), vlc_cond_signal(), vlc_cond_timedwait(), vlc_cond_timedwait_daytime(), vlc_cond_wait(), vlc_lock_marked(), vlc_mutex_destroy(), vlc_mutex_init(), vlc_mutex_lock(), vlc_mutex_marked(), vlc_mutex_marks, vlc_mutex_unlock(), vlc_rwlock_destroy(), vlc_rwlock_init(), vlc_rwlock_rdlock(), vlc_rwlock_unlock(), vlc_rwlock_wrlock(), vlc_sem_destroy(), vlc_sem_init(), vlc_sem_post(), vlc_sem_wait(), vlc_testcancel(), vlc_tick_from_sec, vlc_tick_from_timespec, vlc_tick_now(), vlc_tick_sleep, and vlc_tick_wait.
Referenced by vlc_mutex_marked(), and vlc_player_Lock().
int vlc_mutex_trylock | ( | vlc_mutex_t * | ) |
Tries to acquire a mutex.
This function acquires the mutex if and only if it is not currently held by another thread. This function never sleeps and can be used in delay-critical code paths.
References super_mutex, vlc_mutex_lock(), vlc_mutex_mark(), vlc_mutex_unlock(), and VLC_THREAD_ASSERT.
Referenced by vout_snapshot_IsRequested().
void vlc_mutex_unlock | ( | vlc_mutex_t * | ) |
Releases a mutex.
If the mutex is not held by the calling thread, the behaviour is undefined.
References static_assert, super_mutex, super_variable, vlc_cond_broadcast(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_mutex_unmark(), vlc_sem_destroy(), vlc_sem_init(), vlc_sem_post(), vlc_sem_wait(), vlc_testcancel(), and VLC_THREAD_ASSERT.
Referenced by Add(), AddAlbumCache(), AddCallback(), addons_manager_Delete(), addons_manager_Gather(), addons_manager_WriteCatalog(), aout_ChangeViewpoint(), aout_DecPlay(), aout_Destroy(), aout_DeviceSet(), aout_DevicesList(), aout_HotplugNotify(), aout_MuteSet(), aout_OutputDelete(), aout_OutputNew(), aout_VolumeSet(), ArtCachePath(), background_worker_Cancel(), background_worker_Delete(), background_worker_Push(), background_worker_RequestProbe(), block_FifoCount(), block_FifoShow(), block_FifoSize(), CheckArt(), CheckMeta(), config_SaveConfigFile(), Control(), ControlPop(), Create(), CreateCacheKey(), CreateVoutIfNeeded(), DecoderPlayCc(), DecoderThread(), DecoderThread_AbortPictures(), DecoderThread_ChangeDelay(), DecoderThread_ChangePause(), DecoderThread_ChangeRate(), DecoderThread_Flush(), DecoderThread_ProcessInput(), DecoderUpdatePreroll(), Del(), DelCallback(), DestroyVout(), dialog_cancel_locked(), dialog_display_error_va(), dialog_display_login_va(), dialog_display_question_va(), dialog_id_post(), dialog_remove_locked(), dialog_update_progress(), dialog_wait(), dialog_wait_interrupted(), display_progress_va(), End(), EsOutAdd(), EsOutControl(), EsOutDel(), EsOutFillEsFmt(), EsOutMeta(), EsOutProgramEpg(), EsOutSend(), finder_thread_interrupted(), FinderThread(), getHeldEntryByUUID(), httpd_HostCreate(), httpd_HostDelete(), httpd_StreamCallBack(), httpd_StreamHeader(), httpd_StreamSend(), httpd_StreamSetHTTPHeaders(), httpd_UrlCatch(), httpd_UrlDelete(), httpd_UrlNew(), httpdLoop(), InitTitle(), input_clock_ChangePause(), input_clock_ChangeRate(), input_clock_ChangeSystemOrigin(), input_clock_ConvertTS(), input_clock_GetJitter(), input_clock_GetRate(), input_clock_GetState(), input_clock_GetSystemOrigin(), input_clock_GetWakeup(), input_clock_Reset(), input_clock_SetJitter(), input_clock_Update(), input_ControlPush(), input_DecoderAddVoutOverlay(), input_DecoderDelete(), input_DecoderDelVoutOverlay(), input_DecoderFrameNext(), input_DecoderGetCcDesc(), input_DecoderGetCcState(), input_DecoderHasFormatChanged(), input_DecoderIsEmpty(), input_DecoderSetCcState(), input_DecoderSetSpuHighlight(), input_DecoderSetVoutMouseEvent(), input_DecoderStartWait(), input_DecoderStopWait(), input_DecoderWait(), input_GetAttachment(), input_GetAttachments(), input_item_AddInfo(), input_item_AddOpaque(), input_item_AddOption(), input_item_AddSlave(), input_item_ApplyOptions(), input_item_ChangeEPGSource(), input_item_Copy(), input_item_CopyOptions(), input_item_DelInfo(), input_item_GetDuration(), input_item_GetInfo(), input_item_GetMeta(), input_item_GetName(), input_item_GetTitleFbName(), input_item_GetURI(), input_item_HasErrorWhenReading(), input_item_IsArtFetched(), input_item_IsPreparsed(), input_item_MergeInfos(), input_item_MetaMatch(), input_item_node_AppendItem(), input_item_ReplaceInfos(), input_item_SetArtFetched(), input_item_SetArtNotFound(), input_item_SetDuration(), input_item_SetEpg(), input_item_SetEpgEvent(), input_item_SetEpgOffline(), input_item_SetEpgTime(), input_item_SetErrorWhenReading(), input_item_SetMeta(), input_item_SetName(), input_item_SetPreparsed(), input_item_SetURI(), input_item_ShouldPreparseSubItems(), input_item_UpdateTracksInfo(), input_item_WriteMeta(), input_preparser_Push(), input_rate_Add(), input_resource_GetAout(), input_resource_GetVoutDecoderDevice(), input_resource_HoldAout(), input_resource_HoldVout(), input_resource_HoldVouts(), input_resource_PutAout(), input_resource_PutVout(), input_resource_PutVoutLocked(), input_resource_RequestSout(), input_resource_SetInput(), input_resource_StartVout(), input_resource_StopFreeVout(), input_stats_Compute(), input_Stop(), input_Stopped(), input_thread_Events(), InputSourceMeta(), InputSourceNew(), InputUpdateMeta(), InstallEntry(), installer_thread_interrupted(), InstallerThread(), installOrRemoveAddon(), intf_Create(), intf_DestroyAll(), libvlc_GetMainPlaylist(), libvlc_InternalDialogClean(), libvlc_MetadataRequest(), libvlc_Quit(), libvlc_SetExitHandler(), LoadSlaves(), MainLoopStatistics(), Manage(), MergeSources(), module_EndBank(), module_InitStaticModules(), module_LoadPlugins(), ModuleThread_GetDecoderDevice(), ModuleThread_GetDisplayDate(), ModuleThread_GetDisplayRate(), ModuleThread_NewSpuBuffer(), ModuleThread_PlayAudio(), ModuleThread_PlaySpu(), ModuleThread_PlayVideo(), ModuleThread_QueueSpu(), ModuleThread_QueueThumbnail(), ModuleThread_UpdateAudioFormat(), MouseEvent(), on_thumbnailer_input_event(), picture_fifo_Flush(), picture_fifo_OffsetDate(), picture_fifo_Peek(), picture_fifo_Pop(), picture_fifo_Push(), picture_pool_Cancel(), picture_pool_Get(), picture_pool_ReleasePicture(), picture_pool_Wait(), player_on_state_changed(), ReadAlbumCache(), RemoveThread(), Send(), sout_AnnounceRegisterSDP(), sout_AnnounceUnRegister(), sout_InputControlVa(), sout_InputDelete(), sout_InputFlush(), sout_InputIsEmpty(), sout_InputNew(), sout_InputSendBuffer(), spu_Attach(), spu_ChangeChannelOrderMargin(), spu_ChangeFilters(), spu_ChangeSources(), spu_ClearChannel(), spu_Detach(), spu_prerender_cleanup_routine(), spu_PrerenderCancel(), spu_PrerenderEnqueue(), spu_PrerenderPause(), spu_PrerenderSync(), spu_PrerenderThread(), spu_PrerenderWake(), spu_PutSubpicture(), spu_RegisterChannelInternal(), spu_Render(), spu_SetClockDelay(), spu_SetClockRate(), spu_SetHighlight(), spu_UnregisterChannel(), SpuRenderText(), StereoModeCallback(), TerminateTask(), Thread(), ThreadChangeFilters(), ThreadControl(), ThreadDisplayPreparePicture(), ThreadDisplayRenderPicture(), ThreadFilterFlush(), ThreadProcessMouseState(), thumbnailer_buffer_new(), thumbnailer_request_Probe(), thumbnailer_request_Stop(), TriggerCallback(), TriggerListCallback(), TsChangePause(), TsChangeRate(), TsHasCmd(), TsIsUnused(), TsPushCmd(), TsRun(), TsStop(), update_CheckReal(), var_Change(), var_Create(), var_Destroy(), var_GetAllNames(), var_GetAndSet(), var_GetChecked(), var_SetChecked(), var_TriggerCallback(), var_Type(), vlc_cancel(), vlc_cancel_addr_clear(), vlc_cleanup_lock(), vlc_clock_ConvertArrayToSystem(), vlc_clock_ConvertToSystem(), vlc_clock_Delete(), vlc_clock_main_Abort(), vlc_clock_main_ChangePause(), vlc_clock_main_CreateMaster(), vlc_clock_main_CreateSlave(), vlc_clock_main_Reset(), vlc_clock_main_SetFirstPcr(), vlc_clock_main_SetInputDejitter(), vlc_clock_main_SetMaster(), vlc_clock_master_reset(), vlc_clock_master_set_dejitter(), vlc_clock_master_set_delay(), vlc_clock_master_update(), vlc_clock_slave_reset(), vlc_clock_slave_set_delay(), vlc_clock_slave_update(), vlc_clock_Wait(), vlc_cond_wait_common(), vlc_control_cancel(), vlc_demux_chained_ControlVa(), vlc_demux_chained_Thread(), vlc_dialog_id_get_context(), vlc_dialog_id_set_context(), vlc_dialog_is_cancelled(), vlc_dialog_provider_set_callbacks(), vlc_dialog_provider_set_ext_callback(), vlc_dialog_release(), vlc_drand48(), vlc_event_attach(), vlc_event_detach(), vlc_event_send(), vlc_ext_dialog_update(), vlc_fifo_Unlock(), vlc_gl_surface_CheckSize(), vlc_gl_surface_Create(), vlc_gl_surface_ResizeNotify(), vlc_global_mutex(), vlc_h2_client_output_thread(), vlc_h2_conn_release(), vlc_h2_output_dequeue(), vlc_h2_output_destroy(), vlc_h2_output_queue(), vlc_h2_output_thread(), vlc_h2_recv_thread(), vlc_h2_stream_close(), vlc_h2_stream_open(), vlc_h2_stream_unlock(), vlc_h2_stream_wake_up(), vlc_http_cookies_fetch(), vlc_http_cookies_store(), vlc_interrupt_finish(), vlc_interrupt_prepare(), vlc_interrupt_raise(), vlc_lrand48(), vlc_media_source_provider_GetMediaSource(), vlc_media_source_provider_Remove(), vlc_media_tree_Unlock(), vlc_ml_event_register_callback(), vlc_ml_event_send(), vlc_ml_event_unregister_callback(), vlc_mrand48(), vlc_mutex_lock(), vlc_mutex_marked(), vlc_mutex_trylock(), vlc_mutex_unlock(), vlc_mwait_i11e(), vlc_mwait_i11e_cleanup(), vlc_once(), vlc_player_AddSmpteTimer(), vlc_player_AddTimer(), vlc_player_aout_AddListener(), vlc_player_aout_RemoveListener(), vlc_player_Delete(), vlc_player_destructor_Thread(), vlc_player_GetTimerPoint(), vlc_player_RemoveTimer(), vlc_player_RemoveTimerSource(), vlc_player_ResetTimer(), vlc_player_Unlock(), vlc_player_UpdateTimer(), vlc_player_UpdateTimerState(), vlc_player_vout_AddListener(), vlc_player_vout_RemoveListener(), vlc_playlist_item_meta_New(), vlc_static_cond_init(), vlc_strfplayer(), vlc_thread_cleanup(), vlc_threads_setup(), vlc_threadvar_create(), vlc_threadvar_delete(), vlc_thumbnailer_Cancel(), vlc_timer_schedule(), vlc_timer_thread(), vlc_vaLogEarly(), vlm_Control(), vlm_Delete(), vlm_ExecuteCommand(), vlm_MediaVodControl(), vlm_New(), vout_ChangeCropBorder(), vout_ChangeCropRatio(), vout_ChangeCropWindow(), vout_ChangeDisplayAspectRatio(), vout_ChangeDisplayFilled(), vout_ChangeDisplaySize(), vout_ChangeFullscreen(), vout_ChangePause(), vout_ChangeViewpoint(), vout_ChangeWindowed(), vout_ChangeWindowState(), vout_ChangeZoom(), vout_control_Dead(), vout_control_Hold(), vout_control_Pop(), vout_control_Push(), vout_control_Release(), vout_control_Wake(), vout_DisableWindow(), vout_EnableWindow(), vout_FlushUnlocked(), vout_OSDEpg(), vout_ReleaseDisplay(), vout_snapshot_End(), vout_snapshot_Get(), vout_snapshot_IsRequested(), vout_snapshot_Set(), vout_Start(), vout_UpdateWindowSizeLocked(), vout_window_Delete(), vout_window_New(), vout_window_ReportFullscreen(), vout_window_ReportWindowed(), and vout_window_SetInhibition().
void vlc_once | ( | vlc_once_t *restrict | once, |
void(*)(void) | cb | ||
) |
Executes a function one time.
The first time this function is called with a given one-time initialization object, it executes the provided callback. Any further call with the same object will be a no-op.
In the corner case that the first time execution is ongoing in another thread, then the function will wait for completion on the other thread (and then synchronize memory) before it returns. This ensures that, no matter what, the callback has been executed exactly once and its side effects are visible after the function returns.
once | a one-time initialization object |
cb | callback to execute (the first time) |
void vlc_restorecancel | ( | int | state | ) |
Restores the cancellation state.
This function restores the cancellation state of the calling thread to a state previously saved by vlc_savecancel().
state | previous state as returned by vlc_savecancel(). |
References vlc_thread::killable, state, unlikely, VLC_THREAD_ASSERT, vlc_thread_fatal(), and vlc_thread_self().
Referenced by DecoderThread(), FinderThread(), httpdLoop(), InstallerThread(), Manage(), spu_PrerenderThread(), Thread(), TsRun(), update_CheckReal(), update_DownloadReal(), vlc_h2_output_dequeue(), vlc_h2_recv_thread(), vlc_https_connect_proxy(), vlc_https_recv(), vlc_https_send(), vlc_mutex_lock(), vlc_object_deinit(), vlc_poll_i11e_inner(), vlc_poll_i11e_wake(), vlc_thread_fatal(), vlc_timer_thread(), vlc_tls_ClientSessionCreate(), vlc_tls_ServerSessionCreate(), vlc_tls_SessionDelete(), and vlc_vaLogCallback().
void vlc_rwlock_destroy | ( | vlc_rwlock_t * | ) |
Destroys an initialized unused read/write lock.
References VLC_THREAD_ASSERT.
Referenced by _DLL_InitTerm(), DllMain(), vlc_LogSwitchClose(), and vlc_mutex_marked().
void vlc_rwlock_init | ( | vlc_rwlock_t * | ) |
Initializes a read/write lock.
References unlikely.
Referenced by _DLL_InitTerm(), DllMain(), vlc_LogSwitchCreate(), and vlc_mutex_marked().
void vlc_rwlock_rdlock | ( | vlc_rwlock_t * | ) |
Acquires a read/write lock for reading.
References VLC_THREAD_ASSERT.
Referenced by config_AutoSaveConfigFile(), config_GetFloat(), config_GetInt(), config_GetPsz(), config_SaveConfigFile(), vlc_mutex_marked(), and vlc_vaLogSwitch().
void vlc_rwlock_unlock | ( | vlc_rwlock_t * | ) |
Releases a read/write lock.
The calling thread must hold the lock. Otherwise behaviour is undefined.
References VLC_THREAD_ASSERT.
Referenced by config_AutoSaveConfigFile(), config_GetFloat(), config_GetInt(), config_GetPsz(), config_LoadConfigFile(), config_PutFloat(), config_PutInt(), config_PutPsz(), config_ResetAll(), config_SaveConfigFile(), vlc_LogSwitch(), vlc_mutex_marked(), and vlc_vaLogSwitch().
void vlc_rwlock_wrlock | ( | vlc_rwlock_t * | ) |
Acquires a read/write lock for writing.
Recursion is not allowed.
References VLC_THREAD_ASSERT.
Referenced by config_LoadConfigFile(), config_PutFloat(), config_PutInt(), config_PutPsz(), config_ResetAll(), vlc_LogSwitch(), and vlc_mutex_marked().
int vlc_savecancel | ( | void | ) |
Disables thread cancellation.
This functions saves the current cancellation state (enabled or disabled), then disables cancellation for the calling thread. It must be called before entering a piece of code that is not cancellation-safe, unless it can be proven that the calling thread will not be cancelled.
References vlc_thread::killable, state, VLC_THREAD_ASSERT, and vlc_thread_self().
Referenced by DecoderThread(), FinderThread(), httpdLoop(), InstallerThread(), Manage(), spu_PrerenderThread(), Thread(), TsRun(), update_CheckReal(), update_DownloadReal(), vlc_h2_output_dequeue(), vlc_h2_recv_thread(), vlc_https_connect_proxy(), vlc_https_recv(), vlc_https_send(), vlc_mutex_lock(), vlc_object_deinit(), vlc_poll_i11e_inner(), vlc_poll_i11e_wake(), vlc_thread_fatal(), vlc_timer_thread(), vlc_tls_ClientSessionCreate(), vlc_tls_ServerSessionCreate(), vlc_tls_SessionDelete(), and vlc_vaLogCallback().
void vlc_sem_destroy | ( | vlc_sem_t * | ) |
Deinitializes a semaphore.
References likely, and VLC_THREAD_ASSERT.
Referenced by vlc_getaddrinfo_i11e(), vlc_join(), vlc_mta_acquire(), vlc_mta_release(), vlc_mutex_marked(), vlc_mutex_unlock(), and vlm_OnMediaUpdate().
void vlc_sem_init | ( | vlc_sem_t * | , |
unsigned | count | ||
) |
Initializes a semaphore.
count | initial semaphore value (typically 0) |
References unlikely.
Referenced by vlc_clone_attr(), vlc_getaddrinfo_i11e(), vlc_mta_acquire(), vlc_mutex_marked(), vlc_mutex_unlock(), and vlm_OnMediaUpdate().
int vlc_sem_post | ( | vlc_sem_t * | ) |
Increments the value of a semaphore.
References likely, unlikely, and VLC_THREAD_ASSERT.
Referenced by finish_joinable_thread(), joinable_thread(), MtaMainLoop(), preparse_on_media_meta_changed(), preparse_on_state_changed(), vlc_gai_thread(), vlc_getaddrinfo_notify(), vlc_interrupt_sem(), vlc_mta_release(), vlc_mutex_marked(), and vlc_mutex_unlock().
void vlc_sem_wait | ( | vlc_sem_t * | ) |
Waits on a semaphore.
This function atomically waits for the semaphore to become non-zero then decrements it, and returns. If the semaphore is non-zero on entry, it is immediately decremented.
References likely, and VLC_THREAD_ASSERT.
Referenced by MtaMainLoop(), vlc_getaddrinfo_i11e(), vlc_join(), vlc_mta_acquire(), vlc_mutex_marked(), vlc_mutex_unlock(), vlc_sem_wait_i11e(), and vlm_OnMediaUpdate().
void vlc_testcancel | ( | void | ) |
Issues an explicit deferred cancellation point.
This has no effects if thread cancellation is disabled. This can be called when there is a rather slow non-sleeping operation. This is also used to force a cancellation point in a function that would otherwise not always be one (block_FifoGet() is an example).
References vlc_thread::cancel_event, vlc_thread::cleaners, vlc_thread::data, vlc_thread::done_event, vlc_thread::id, vlc_thread::killable, vlc_thread::killed, p, vlc_cancel_self(), vlc_thread_cleanup(), vlc_thread_destroy(), and vlc_thread_self().
Referenced by block_FifoGet(), DecoderThread(), net_Read(), net_Write(), vlc_cond_wait_common(), vlc_join(), vlc_mutex_marked(), vlc_mutex_unlock(), vlc_poll_i11e_inner(), vlc_select(), vlc_tick_now(), and vlc_tick_wait().
unsigned long vlc_thread_id | ( | void | ) |
Thread identifier.
This function returns the identifier of the calling thread. The identifier cannot change for the entire duration of the thread, and no other thread can have the same identifier at the same time in the same process. Typically, the identifier is also unique across all running threads of all existing processes, but that depends on the operating system.
There are no particular semantics to the thread ID with LibVLC. It is provided mainly for tracing and debugging.
References unlikely.
Referenced by vlc_thread_fatal(), vlc_thread_fatal_print(), and vlc_vaLog().
vlc_thread_t vlc_thread_self | ( | void | ) |
Thread handle.
This function returns the thread handle of the calling thread.
References vlc_thread::thread, thread, thread_key, and vlc_threadvar_get().
Referenced by vlc_control_cancel(), vlc_DosWaitEventSemEx(), vlc_restorecancel(), vlc_savecancel(), vlc_select(), and vlc_testcancel().
int vlc_threadvar_create | ( | vlc_threadvar_t * | key, |
void(*)(void *) | destr | ||
) |
Allocates a thread-specific variable.
key | where to store the thread-specific variable handle |
destr | a destruction callback. It is called whenever a thread exits and the thread-specific variable has a non-NULL value. |
References vlc_threadvar::destroy, vlc_threadvar::id, vlc_threadvar::next, vlc_threadvar::prev, super_mutex, unlikely, var, vlc_mutex_lock(), vlc_mutex_unlock(), and vlc_threadvar_last.
Referenced by _DLL_InitTerm().
void vlc_threadvar_delete | ( | vlc_threadvar_t * | ) |
Deallocates a thread-specific variable.
References vlc_threadvar::id, vlc_threadvar::next, vlc_threadvar::prev, super_mutex, var, vlc_mutex_lock(), vlc_mutex_unlock(), and vlc_threadvar_last.
Referenced by _DLL_InitTerm().
void* vlc_threadvar_get | ( | vlc_threadvar_t | ) |
Gets the value of a thread-local variable for the calling thread.
This function cannot fail.
Referenced by vlc_thread_cleanup(), vlc_thread_self(), and vlc_threadvars_cleanup().
int vlc_threadvar_set | ( | vlc_threadvar_t | key, |
void * | value | ||
) |
Sets a thread-specific variable.
key | thread-local variable key (created with vlc_threadvar_create()) |
value | new value for the variable for the calling thread |
Referenced by vlc_entry(), vlc_thread_cleanup(), and vlc_threadvars_cleanup().
vlc_tick_t vlc_tick_now | ( | void | ) |
Precision monotonic clock.
In principles, the clock has a precision of 1 MHz. But the actual resolution may be much lower, especially when it comes to sleeping with vlc_tick_wait() or vlc_tick_sleep(). Most general-purpose operating systems provide a resolution of only 100 to 1000 Hz.
References freq, lldiv(), mdate_selected, Q2LL, lldiv_t::quot, lldiv_t::rem, unlikely, vlc_clock_conversion, vlc_clock_setup, vlc_testcancel(), VLC_TICK_FROM_NS, vlc_tick_from_samples(), vlc_tick_from_sec, vlc_tick_from_timespec, vlc_tick_now(), vlc_tick_sleep(), and vlc_tick_wait().
Referenced by aout_DecDrain(), aout_DecPlay(), aout_DecSilence(), CmdInitAdd(), CmdInitControl(), CmdInitDel(), CmdInitSend(), Control(), EsOutDecodersStopBuffering(), EsOutGetBuffering(), EsOutVaControlLocked(), httpdLoop(), ImageRead(), Init(), input_clock_ConvertTS(), input_DecoderAddVoutOverlay(), input_rate_Add(), input_thread_Events(), MainLoop(), net_Connect(), OSDWidget(), QueueTake(), RunThread(), sout_AnnounceRegisterSDP(), sout_MuxSendBuffer(), spu_PrerenderText(), spu_PutSubpicture(), Thread(), ThreadDisplayPicture(), ThreadDisplayPreparePicture(), ThreadDisplayRenderPicture(), TsStart(), vlc_cond_timedwait(), vlc_demux_chained_Thread(), vlc_msleep_i11e(), vlc_mutex_marked(), vlc_player_input_GetPos(), vlc_player_input_GetTime(), vlc_player_WaitRetryDelay(), vlc_tick_now(), vlc_tick_sleep(), vlc_tick_wait(), vlc_timer_schedule(), vlc_timer_thread(), vlc_tls_ClientSessionCreate(), vout_chrono_Start(), vout_chrono_Stop(), vout_display_window_MouseEvent(), vout_OSDEpg(), vout_OSDText(), vout_SetInterlacingState(), vout_snapshot_Get(), and VoutSnapshotPip().
void vlc_tick_sleep | ( | vlc_tick_t | delay | ) |
Waits for an interval of time.
delay | how long to wait (in microseconds) |
References timespec_from_vlc_tick(), vlc_tick_now(), and vlc_tick_wait().
Referenced by vlc_tick_now(), and vlc_tick_wait().
void vlc_tick_wait | ( | vlc_tick_t | deadline | ) |
Waits until a deadline.
deadline | timestamp to wait for (vlc_tick_now()) |
References timespec_from_vlc_tick(), unlikely, vlc_clock_once, vlc_clock_prec, vlc_clock_setup_once(), vlc_Sleep(), vlc_testcancel(), vlc_tick_now(), and vlc_tick_sleep().
Referenced by vlc_tick_now(), and vlc_tick_sleep().
int vlc_timer_create | ( | vlc_timer_t * | id, |
void(*)(void *) | func, | ||
void * | data | ||
) |
Initializes an asynchronous timer.
id | pointer to timer to be initialized |
func | function that the timer will call |
data | parameter for the timer function |
References vlc_thread::data, vlc_timer::data, vlc_timer::func, vlc_timer::handle, vlc_timer::hev, vlc_timer::htimer, vlc_timer::interval, vlc_timer::lock, vlc_timer::overruns, vlc_timer::quit, vlc_timer::reschedule, vlc_timer::thread, vlc_timer::tid, unlikely, vlc_timer::value, vlc_clone(), vlc_cond_destroy(), vlc_cond_init(), vlc_mutex_destroy(), vlc_mutex_init(), VLC_THREAD_PRIORITY_INPUT, vlc_timer_do(), and vlc_timer_thread().
void vlc_timer_destroy | ( | vlc_timer_t | timer | ) |
Destroys an initialized timer.
If needed, the timer is first disarmed. Behaviour is undefined if the specified timer is not initialized.
timer | timer to destroy |
References vlc_timer::handle, vlc_timer::hev, vlc_timer::htimer, vlc_timer::lock, vlc_timer::quit, vlc_timer::reschedule, vlc_timer::thread, vlc_timer::tid, vlc_cancel(), vlc_cond_destroy(), vlc_join(), and vlc_mutex_destroy().
|
inlinestatic |
References VLC_TIMER_DISARM, and vlc_timer_schedule().
unsigned vlc_timer_getoverrun | ( | vlc_timer_t | ) |
Fetches and resets the overrun counter for a timer.
This functions returns the number of times that the interval timer should have fired, but the callback was not invoked due to scheduling problems. The call resets the counter to zero.
timer | initialized timer |
References vlc_timer::overruns.
Referenced by vlc_timer_schedule_asap().
void vlc_timer_schedule | ( | vlc_timer_t | timer, |
bool | absolute, | ||
vlc_tick_t | value, | ||
vlc_tick_t | interval | ||
) |
Arms or disarms an initialized timer.
This functions overrides any previous call to itself.
timer | initialized timer |
absolute | the timer value origin is the same as vlc_tick_now() if true, the timer value is relative to now if false. |
value | zero to disarm the timer, otherwise the initial time to wait before firing the timer. |
interval | zero to fire the timer just once, otherwise the timer repetition interval. |
References vlc_timer::handle, vlc_timer::hev, vlc_timer::htimer, vlc_timer::interval, vlc_timer::lock, MS_FROM_VLC_TICK, vlc_timer::reschedule, vlc_timer::value, vlc_cond_signal(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_tick_now(), VLC_TIMER_DISARM, and vlc_timer_do().
Referenced by vlc_timer_disarm(), and vlc_timer_schedule_asap().
|
inlinestatic |
References VLC_API, vlc_GetCPUCount(), vlc_timer_getoverrun(), vlc_timer_schedule(), and VLC_USED.