VLC 4.0.0-dev
Loading...
Searching...
No Matches
thread.c File Reference
Include dependency graph for thread.c:

Data Structures

struct  vlc_thread

Macros

#define VLC_THREAD_ASSERT(action)

Functions

static void vlc_clock_setup_once (void)
static void vlc_thread_fatal_print (const char *action, int error, const char *function, const char *file, unsigned line)
void vlc_threads_setup (libvlc_int_t *p_libvlc)
static void * joinable_thread (void *data)
static int vlc_clone_attr (vlc_thread_t *th, void *(*entry)(void *), void *data)
int vlc_clone (vlc_thread_t *th, void *(*entry)(void *), void *data)
 Creates and starts a new thread.
void vlc_join (vlc_thread_t handle, void **result)
 Waits for a thread to complete (if needed), then destroys it.
void vlc_cancel (vlc_thread_t thread_id)
 Marks a thread as cancelled.
int vlc_savecancel (void)
 Disables thread cancellation.
void vlc_restorecancel (int state)
 Restores the cancellation state.
void vlc_testcancel (void)
 Issues an explicit deferred cancellation point.
int vlc_threadvar_create (vlc_threadvar_t *key, void(*destr)(void *))
 Allocates a thread-specific variable.
void vlc_threadvar_delete (vlc_threadvar_t *p_tls)
 Deallocates a thread-specific variable.
int vlc_threadvar_set (vlc_threadvar_t key, void *value)
 Sets a thread-specific variable.
void * vlc_threadvar_get (vlc_threadvar_t key)
 Gets the value of a thread-local variable for the calling thread.
void vlc_tick_wait (vlc_tick_t deadline)
 Waits until a deadline.
void vlc_tick_sleep (vlc_tick_t delay)
 Waits for an interval of time.
vlc_tick_t vlc_tick_now (void)
 Precision monotonic clock.
unsigned vlc_GetCPUCount (void)
 Count CPUs.

Variables

static unsigned vlc_clock_prec
static struct vlc_threadthread = NULL

Macro Definition Documentation

◆ VLC_THREAD_ASSERT

#define VLC_THREAD_ASSERT ( action)
Value:
do { \
if (unlikely(val)) { \
vlc_thread_fatal_print (action, val, __func__, __FILE__, __LINE__); \
assert (!action); \
} \
} while(0)
#define unlikely(p)
Predicted false condition.
Definition vlc_common.h:248

Referenced by vlc_join(), vlc_join(), vlc_restorecancel(), and vlc_savecancel().

Function Documentation

◆ joinable_thread()

void * joinable_thread ( void * data)
static

References vlc_thread::data, thread, and VLC_THREAD_CANCELED.

Referenced by vlc_clone_attr().

◆ vlc_clock_setup_once()

void vlc_clock_setup_once ( void )
static

◆ vlc_clone_attr()

int vlc_clone_attr ( vlc_thread_t * th,
void *(* entry )(void *),
void * data )
static

References vlc_thread::data, joinable_thread(), thread, and unlikely.

Referenced by vlc_clone().

◆ vlc_thread_fatal_print()

void vlc_thread_fatal_print ( const char * action,
int error,
const char * function,
const char * file,
unsigned line )
static

◆ vlc_threads_setup()

void vlc_threads_setup ( libvlc_int_t * p_libvlc)

Referenced by libvlc_InternalInit().

Variable Documentation

◆ thread

◆ vlc_clock_prec

unsigned vlc_clock_prec
static