VLC  4.0.0-dev
Data Structures | Macros | Enumerations | Functions | Variables
threads.c File Reference
Include dependency graph for threads.c:

Data Structures

struct  vlc_suuint
 
struct  vlc_cond_waiter
 

Macros

#define vlc_cancel_addr_prepare(addr)   ((void)0)
 
#define vlc_cancel_addr_finish(addr)   ((void)0)
 
#define THREAD_SELF   ((const void *)thread_self)
 
#define READER_MASK   LONG_MAX
 
#define WRITER_BIT   LONG_MIN
 

Enumerations

enum  { VLC_ONCE_UNDONE, VLC_ONCE_DOING, VLC_ONCE_CONTEND, VLC_ONCE_DONE }
 

Functions

void vlc_global_mutex (unsigned n, bool acquire)
 Internal handler for global mutexes. More...
 
static void vlc_mutex_init_common (vlc_mutex_t *mtx, bool recursive)
 
void vlc_mutex_init (vlc_mutex_t *mtx)
 Initializes a fast mutex. More...
 
void vlc_mutex_init_recursive (vlc_mutex_t *mtx)
 Initializes a recursive mutex. More...
 
bool vlc_mutex_held (const vlc_mutex_t *mtx)
 Checks if a mutex is locked. More...
 
void vlc_mutex_lock (vlc_mutex_t *mtx)
 Acquires a mutex. More...
 
int vlc_mutex_trylock (vlc_mutex_t *mtx)
 Tries to acquire a mutex. More...
 
void vlc_mutex_unlock (vlc_mutex_t *mtx)
 Releases a mutex. More...
 
void vlc_cond_init (vlc_cond_t *cond)
 Initializes a condition variable. More...
 
static void vlc_cond_signal_waiter (struct vlc_cond_waiter *waiter)
 
void vlc_cond_signal (vlc_cond_t *cond)
 Wakes up one thread waiting on a condition variable. More...
 
void vlc_cond_broadcast (vlc_cond_t *cond)
 Wakes up all threads waiting on a condition variable. More...
 
static void vlc_cond_wait_prepare (struct vlc_cond_waiter *waiter, vlc_cond_t *cond, vlc_mutex_t *mutex)
 
static void vlc_cond_wait_finish (struct vlc_cond_waiter *waiter, vlc_cond_t *cond, vlc_mutex_t *mutex)
 
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 *cond, vlc_mutex_t *mutex, time_t deadline)
 
void vlc_rwlock_init (vlc_rwlock_t *lock)
 Initializes a read/write lock. More...
 
void vlc_rwlock_rdlock (vlc_rwlock_t *lock)
 Acquires a read/write lock for reading. More...
 
void vlc_rwlock_wrlock (vlc_rwlock_t *lock)
 Acquires a read/write lock for writing. More...
 
void vlc_rwlock_unlock (vlc_rwlock_t *lock)
 Releases a read/write lock. More...
 
void vlc_sem_init (vlc_sem_t *sem, unsigned value)
 Initializes a semaphore. More...
 
int vlc_sem_post (vlc_sem_t *sem)
 Increments the value of a semaphore. More...
 
void vlc_sem_wait (vlc_sem_t *sem)
 Waits on a semaphore. More...
 
int vlc_sem_timedwait (vlc_sem_t *sem, vlc_tick_t deadline)
 Waits on a semaphore within a deadline. More...
 
int vlc_sem_trywait (vlc_sem_t *sem)
 Tries to decrement a semaphore. More...
 
void() vlc_once (vlc_once_t *restrict once, void(*cb)(void))
 

Variables

static _Thread_local char thread_self [1]
 

Macro Definition Documentation

◆ READER_MASK

#define READER_MASK   LONG_MAX

◆ THREAD_SELF

#define THREAD_SELF   ((const void *)thread_self)

◆ vlc_cancel_addr_finish

#define vlc_cancel_addr_finish (   addr)    ((void)0)

◆ vlc_cancel_addr_prepare

#define vlc_cancel_addr_prepare (   addr)    ((void)0)

◆ WRITER_BIT

#define WRITER_BIT   LONG_MIN

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
VLC_ONCE_UNDONE 
VLC_ONCE_DOING 
VLC_ONCE_CONTEND 
VLC_ONCE_DONE 

Function Documentation

◆ vlc_cond_signal_waiter()

static void vlc_cond_signal_waiter ( struct vlc_cond_waiter waiter)
static

◆ vlc_cond_wait_finish()

static void vlc_cond_wait_finish ( struct vlc_cond_waiter waiter,
vlc_cond_t cond,
vlc_mutex_t mutex 
)
static

◆ vlc_cond_wait_prepare()

static void vlc_cond_wait_prepare ( struct vlc_cond_waiter waiter,
vlc_cond_t cond,
vlc_mutex_t mutex 
)
static

◆ vlc_mutex_init_common()

static void vlc_mutex_init_common ( vlc_mutex_t mtx,
bool  recursive 
)
static

◆ vlc_once()

void() vlc_once ( vlc_once_t *restrict  once,
void(*)(void)  cb 
)

Variable Documentation

◆ thread_self

_Thread_local char thread_self[1]
static