VLC 4.0.0-dev
|
Data Structures | |
struct | vlc_thread |
struct | vlc_threadvar |
struct | wait_bucket |
struct | vlc_timer |
Macros | |
#define | Q2LL(q) ( *( long long * )&( q )) |
Functions | |
static void | vlc_cancel_self (PVOID dummy) |
static ULONG | vlc_DosWaitEventSemEx (HEV hev, ULONG ulTimeout) |
static ULONG | vlc_WaitForSingleObject (HEV hev, ULONG ulTimeout) |
static ULONG | vlc_Sleep (ULONG ulTimeout) |
int | vlc_threadvar_create (vlc_threadvar_t *p_tls, void(*destr)(void *)) |
Allocates a thread-specific variable. More... | |
void | vlc_threadvar_delete (vlc_threadvar_t *p_tls) |
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 key) |
Gets the value of a thread-local variable for the calling thread. More... | |
static void | wait_bucket_init (void) |
static void | wait_bucket_destroy (void) |
static struct wait_bucket * | wait_bucket_get (atomic_uint *addr) |
static struct wait_bucket * | wait_bucket_enter (atomic_uint *addr) |
static void | wait_bucket_leave (void *data) |
void | vlc_atomic_wait (void *addr, unsigned value) |
Waits on an address. More... | |
int | vlc_atomic_timedwait (void *addr, unsigned value, vlc_tick_t deadline) |
Waits on an address with a time-out. More... | |
int | vlc_atomic_timedwait_daytime (void *addr, unsigned value, time_t deadline) |
void | vlc_atomic_notify_one (void *addr) |
Wakes up one thread on an address. More... | |
void | vlc_atomic_notify_all (void *addr) |
Wakes up all thread on an address. More... | |
void | vlc_threads_setup (libvlc_int_t *p_libvlc) |
static void | vlc_thread_cleanup (struct vlc_thread *th) |
static void | vlc_entry (void *p) |
int | vlc_clone (vlc_thread_t *p_handle, void *(*entry)(void *), void *data) |
Creates and starts a new thread. More... | |
void | vlc_join (vlc_thread_t th, void **result) |
Waits for a thread to complete (if needed), then destroys it. More... | |
unsigned long | vlc_thread_id (void) |
Thread identifier. More... | |
void() | vlc_thread_set_name (const char *name) |
Set the thread name of the current thread. More... | |
void | vlc_cancel (vlc_thread_t th) |
Marks a thread as cancelled. More... | |
int | vlc_savecancel (void) |
Disables thread cancellation. More... | |
void | vlc_restorecancel (int state) |
Restores the cancellation state. More... | |
void | vlc_testcancel (void) |
Issues an explicit deferred cancellation point. More... | |
void | vlc_control_cancel (vlc_cleanup_t *cleaner) |
Internal handler for thread cancellation. More... | |
static int | vlc_select (int nfds, fd_set *rdset, fd_set *wrset, fd_set *exset, struct timeval *timeout) |
__declspec (dllexport) | |
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... | |
static void | vlc_timer_do (void *arg) |
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... | |
unsigned | vlc_timer_getoverrun (vlc_timer_t timer) |
Fetches and resets the overrun counter for a timer. More... | |
unsigned | vlc_GetCPUCount (void) |
Count CPUs. More... | |
int | _CRT_init (void) |
void | _CRT_term (void) |
unsigned long _System | _DLL_InitTerm (unsigned long, unsigned long) |
Variables | |
static vlc_mutex_t | super_mutex = { .value = ATOMIC_VAR_INIT(0), .recursion = ATOMIC_VAR_INIT(0), .owner = ATOMIC_VAR_INIT(0), } |
static thread_local struct vlc_thread * | current_thread_ctx = NULL |
struct vlc_threadvar * | vlc_threadvar_last = NULL |
static struct wait_bucket | wait_buckets [32] |
#define Q2LL | ( | q | ) | ( *( long long * )&( q )) |
__declspec | ( | dllexport | ) |
int _CRT_init | ( | void | ) |
Referenced by _DLL_InitTerm().
void _CRT_term | ( | void | ) |
Referenced by _DLL_InitTerm().
unsigned long _System _DLL_InitTerm | ( | unsigned long | hmod, |
unsigned long | flag | ||
) |
References _CRT_init(), _CRT_term(), vlc_threadvar_last, VLC_UNUSED, wait_bucket_destroy(), and wait_bucket_init().
void vlc_atomic_notify_all | ( | 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_atomic_wait() or vlc_atomic_timedwait() with the specified address as first call parameter will be woken up.
addr | address identifying which threads to wake up |
References wait_bucket::lock, wait_bucket::wait, wait_bucket_get(), and wait_bucket::waiters.
void vlc_atomic_notify_one | ( | 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_atomic_wait() or vlc_atomic_timedwait() functions. If no threads are found, this function does nothing.
addr | address identifying which threads may be woken up |
References vlc_atomic_notify_all().
int vlc_atomic_timedwait | ( | void * | addr, |
unsigned | val, | ||
vlc_tick_t | deadline | ||
) |
Waits on an address with a time-out.
This function operates as vlc_atomic_wait() but provides an additional time-out. If the deadline is reached, the thread resumes and the function returns.
addr | address to check for |
val | value to match at the address |
deadline | deadline to wait until |
0 | the function was woken up before the time-out |
ETIMEDOUT | the deadline was reached |
References count, wait_bucket::lock, MS_FROM_VLC_TICK, vlc_cleanup_pop, vlc_cleanup_push, vlc_testcancel(), VLC_TICK_FROM_MS, vlc_tick_now(), vlc_WaitForSingleObject(), wait_bucket::wait, wait_bucket_enter(), and wait_bucket_leave().
int vlc_atomic_timedwait_daytime | ( | void * | addr, |
unsigned | value, | ||
time_t | deadline | ||
) |
void vlc_atomic_wait | ( | void * | addr, |
unsigned | val | ||
) |
Waits on an address.
Puts the calling thread to sleep if a specific unsigned 32-bits value is stored at a specified address. The thread will sleep until it is woken up by a call to vlc_atomic_notify_one() or vlc_atomic_notify_all() 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 count, wait_bucket::lock, vlc_cleanup_pop, vlc_cleanup_push, vlc_testcancel(), vlc_WaitForSingleObject(), wait_bucket::wait, wait_bucket_enter(), and wait_bucket_leave().
|
static |
References vlc_thread::killed, and likely.
Referenced by vlc_DosWaitEventSemEx(), and vlc_testcancel().
|
static |
References vlc_thread::cancel_event, current_thread_ctx, vlc_thread::killable, and vlc_cancel_self().
Referenced by vlc_Sleep(), and vlc_WaitForSingleObject().
|
static |
References current_thread_ctx, vlc_thread::data, vlc_thread::done_event, vlc_thread::entry, vlc_thread::killable, p, VLC_THREAD_CANCELED, and vlc_thread_cleanup().
Referenced by vlc_clone().
|
static |
References vlc_thread::cancel_sock, current_thread_ctx, MAX, and vlc_testcancel().
|
static |
References vlc_DosWaitEventSemEx().
Referenced by vlc_tick_wait().
|
static |
References vlc_threadvar::prev, super_mutex, vlc_mutex_lock(), vlc_mutex_unlock(), vlc_threadvar_get(), vlc_threadvar_last, and vlc_threadvar_set().
Referenced by vlc_entry(), and vlc_testcancel().
void vlc_threads_setup | ( | libvlc_int_t * | p_libvlc | ) |
|
static |
References arg, count, vlc_timer::data, vlc_timer::func, vlc_timer::hev, vlc_timer::htimer, vlc_timer::interval, and vlc_timer::quit.
Referenced by vlc_timer_create().
|
static |
References vlc_DosWaitEventSemEx().
Referenced by vlc_atomic_timedwait(), vlc_atomic_timedwait_daytime(), vlc_atomic_wait(), and vlc_join().
|
static |
References ARRAY_SIZE, wait_bucket::lock, wait_bucket::wait, and wait_buckets.
Referenced by _DLL_InitTerm().
|
static |
References wait_bucket::lock, wait_bucket_get(), and wait_bucket::waiters.
Referenced by vlc_atomic_timedwait(), vlc_atomic_timedwait_daytime(), and vlc_atomic_wait().
|
static |
References ARRAY_SIZE, and wait_buckets.
Referenced by vlc_atomic_notify_all(), and wait_bucket_enter().
|
static |
References ARRAY_SIZE, wait_bucket::lock, wait_bucket::wait, and wait_buckets.
Referenced by _DLL_InitTerm().
|
static |
References wait_bucket::lock, and wait_bucket::waiters.
Referenced by vlc_atomic_timedwait(), vlc_atomic_timedwait_daytime(), and vlc_atomic_wait().
|
static |
Referenced by vlc_control_cancel(), vlc_DosWaitEventSemEx(), vlc_entry(), vlc_restorecancel(), vlc_savecancel(), vlc_select(), and vlc_testcancel().
|
static |
Referenced by vlc_thread_cleanup(), vlc_threadvar_create(), and vlc_threadvar_delete().
struct vlc_threadvar * vlc_threadvar_last = NULL |
Referenced by _DLL_InitTerm(), vlc_thread_cleanup(), vlc_threadvar_create(), vlc_threadvar_delete(), and vlc_threadvars_cleanup().
|
static |
Referenced by wait_bucket_destroy(), wait_bucket_get(), and wait_bucket_init().