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

Data Structures

struct  wait_bucket
 

Macros

#define WAIT_BUCKET_INIT   { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 }
 
#define WAIT_BUCKET_INIT_2   WAIT_BUCKET_INIT, WAIT_BUCKET_INIT
 
#define WAIT_BUCKET_INIT_4   WAIT_BUCKET_INIT_2, WAIT_BUCKET_INIT_2
 
#define WAIT_BUCKET_INIT_8   WAIT_BUCKET_INIT_4, WAIT_BUCKET_INIT_4
 
#define WAIT_BUCKET_INIT_16   WAIT_BUCKET_INIT_8, WAIT_BUCKET_INIT_8
 
#define WAIT_BUCKET_INIT_32   WAIT_BUCKET_INIT_16, WAIT_BUCKET_INIT_16
 

Functions

static struct wait_bucketwait_bucket_get (atomic_uint *addr)
 
static struct wait_bucketwait_bucket_enter (atomic_uint *addr)
 
static void wait_bucket_leave (struct wait_bucket *bucket)
 
void vlc_atomic_wait (void *addr, unsigned value)
 Waits on an address. More...
 
static int vlc_atomic_timedwait_timespec (void *addr, unsigned value, const struct timespec *restrict ts)
 
static void vlc_timespec_adjust (clockid_t cid, struct timespec *restrict ts)
 
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...
 

Variables

static clockid_t vlc_clock_id = CLOCK_REALTIME
 
static struct wait_bucket wait_buckets [32] = { { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } }
 

Macro Definition Documentation

◆ WAIT_BUCKET_INIT

#define WAIT_BUCKET_INIT   { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 }

◆ WAIT_BUCKET_INIT_16

#define WAIT_BUCKET_INIT_16   WAIT_BUCKET_INIT_8, WAIT_BUCKET_INIT_8

◆ WAIT_BUCKET_INIT_2

#define WAIT_BUCKET_INIT_2   WAIT_BUCKET_INIT, WAIT_BUCKET_INIT

◆ WAIT_BUCKET_INIT_32

#define WAIT_BUCKET_INIT_32   WAIT_BUCKET_INIT_16, WAIT_BUCKET_INIT_16

◆ WAIT_BUCKET_INIT_4

#define WAIT_BUCKET_INIT_4   WAIT_BUCKET_INIT_2, WAIT_BUCKET_INIT_2

◆ WAIT_BUCKET_INIT_8

#define WAIT_BUCKET_INIT_8   WAIT_BUCKET_INIT_4, WAIT_BUCKET_INIT_4

Function Documentation

◆ vlc_atomic_timedwait_timespec()

static int vlc_atomic_timedwait_timespec ( void *  addr,
unsigned  value,
const struct timespec *restrict  ts 
)
static

◆ vlc_timespec_adjust()

static void vlc_timespec_adjust ( clockid_t  cid,
struct timespec *restrict  ts 
)
static

◆ wait_bucket_enter()

static struct wait_bucket* wait_bucket_enter ( atomic_uint *  addr)
static

◆ wait_bucket_get()

static struct wait_bucket* wait_bucket_get ( atomic_uint *  addr)
static

◆ wait_bucket_leave()

static void wait_bucket_leave ( struct wait_bucket bucket)
static

Variable Documentation

◆ vlc_clock_id

clockid_t vlc_clock_id = CLOCK_REALTIME
static

◆ wait_buckets

struct wait_bucket wait_buckets[32] = { { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } , { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, 0 } }
static