VLC 4.0.0-dev
|
Functions | |
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... | |
static int | vlc_umtx_wake (void *addr, int nr) |
static int | vlc_umtx_wait (void *addr, unsigned val, const struct timespec *ts) |
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_atomic_wait (void *addr, unsigned val) |
Waits on an address. More... | |
int | vlc_atomic_timedwait (void *addr, unsigned val, vlc_tick_t deadline) |
Waits on an address with a time-out. More... | |
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 vlc_umtx_wake().
Referenced by vlc_atomic_notify_one(), vlc_latch_count_down_ready(), vlc_once_complete(), and vlc_queuedmutex_unlock().
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_umtx_wake().
Referenced by vlc_cancel(), vlc_cond_signal_waiter(), vlc_mutex_unlock(), vlc_rcu_read_unlock(), and vlc_sem_post().
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 vlc_tick_to_timespec(), and vlc_umtx_wait().
Referenced by vlc_cond_timedwait(), vlc_sem_timedwait(), and vlc_tick_wait().
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 vlc_umtx_wait().
Referenced by vlc_cond_wait(), vlc_latch_wait(), vlc_mutex_lock(), vlc_once_begin(), vlc_queuedmutex_lock(), vlc_rcu_synchronize(), and vlc_sem_wait().
|
static |
Referenced by vlc_atomic_timedwait(), and vlc_atomic_wait().
|
static |
Referenced by vlc_atomic_notify_all(), and vlc_atomic_notify_one().