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

Macros

#define VLC_THREAD_ASSERT(action)
 
#define VLC_STACKSIZE   (128 * sizeof (void *) * 1024)
 

Functions

static void vlc_clock_setup_once (void)
 
void vlc_trace (const char *fn, const char *file, unsigned line)
 Print a backtrace to the standard error for debugging purpose. More...
 
static void vlc_thread_fatal (const char *action, int error, const char *function, const char *file, unsigned line)
 Reports a fatal error from the threading layer, for debugging purposes. More...
 
int vlc_threadvar_create (vlc_threadvar_t *key, 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...
 
void vlc_threads_setup (libvlc_int_t *p_libvlc)
 
static int vlc_clone_attr (vlc_thread_t *th, pthread_attr_t *attr, void *(*entry)(void *), void *data, int priority)
 
int vlc_clone (vlc_thread_t *th, void *(*entry)(void *), void *data, int priority)
 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...
 
int vlc_set_priority (vlc_thread_t th, int priority)
 
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...
 
vlc_tick_t vlc_tick_now (void)
 Precision monotonic clock. More...
 
void vlc_tick_wait (vlc_tick_t deadline)
 
void vlc_tick_sleep (vlc_tick_t delay)
 
unsigned vlc_GetCPUCount (void)
 Count CPUs. More...
 

Variables

static unsigned vlc_clock_prec
 

Macro Definition Documentation

◆ VLC_STACKSIZE

#define VLC_STACKSIZE   (128 * sizeof (void *) * 1024)

◆ VLC_THREAD_ASSERT

#define VLC_THREAD_ASSERT (   action)
Value:
if (unlikely(val)) \
vlc_thread_fatal (action, val, __func__, __FILE__, __LINE__)
#define unlikely(p)
Predicted false condition.
Definition: vlc_common.h:228

Function Documentation

◆ vlc_clock_setup_once()

static void vlc_clock_setup_once ( void  )
static

◆ vlc_clone_attr()

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

References vlc_thread_t::handle, and VLC_STACKSIZE.

Referenced by vlc_clone().

◆ vlc_set_priority()

int vlc_set_priority ( vlc_thread_t  th,
int  priority 
)

References VLC_SUCCESS.

◆ vlc_thread_fatal()

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

Reports a fatal error from the threading layer, for debugging purposes.

References vlc_restorecancel(), vlc_savecancel(), vlc_thread_id(), and vlc_trace().

Referenced by vlc_restorecancel().

◆ vlc_threads_setup()

void vlc_threads_setup ( libvlc_int_t p_libvlc)

◆ vlc_tick_sleep()

void vlc_tick_sleep ( vlc_tick_t  delay)

◆ vlc_tick_wait()

void vlc_tick_wait ( vlc_tick_t  deadline)

◆ vlc_trace()

void vlc_trace ( const char *  fn,
const char *  file,
unsigned  line 
)

Print a backtrace to the standard error for debugging purpose.

References ARRAY_SIZE, and fsync().

Referenced by vlc_thread_fatal().

Variable Documentation

◆ vlc_clock_prec

unsigned vlc_clock_prec
static