VLC  3.0.21
Data Structures | Macros | Typedefs | Functions | Variables
thread.c File Reference
Include dependency graph for thread.c:

Data Structures

struct  vlc_thread
 
struct  vlc_static_cond_t
 
struct  vlc_threadvar
 
struct  vlc_timer
 

Macros

#define Q2LL(q)   ( *( long long * )&( q ))
 

Typedefs

typedef struct vlc_static_cond_t vlc_static_cond_t
 

Functions

static void vlc_cancel_self (PVOID dummy)
 
static ULONG vlc_DosWaitEventSemEx (HEV hev, ULONG ulTimeout)
 
static ULONG vlc_WaitForSingleObject (HEV hev, ULONG ulTimeout)
 
static ULONG vlc_Sleep (ULONG ulTimeout)
 
static void vlc_static_cond_destroy_all (void)
 
int _CRT_init (void)
 
void _CRT_term (void)
 
unsigned long _System _DLL_InitTerm (unsigned long, unsigned long)
 
void vlc_mutex_init (vlc_mutex_t *p_mutex)
 Initializes a fast mutex. More...
 
void vlc_mutex_init_recursive (vlc_mutex_t *p_mutex)
 Initializes a recursive mutex. More...
 
void vlc_mutex_destroy (vlc_mutex_t *p_mutex)
 Deinitializes a mutex. More...
 
void vlc_mutex_lock (vlc_mutex_t *p_mutex)
 Acquires a mutex. More...
 
int vlc_mutex_trylock (vlc_mutex_t *p_mutex)
 Tries to acquire a mutex. More...
 
void vlc_mutex_unlock (vlc_mutex_t *p_mutex)
 Releases a mutex. More...
 
static void vlc_static_cond_init (vlc_cond_t *p_condvar)
 
void vlc_cond_init (vlc_cond_t *p_condvar)
 Initializes a condition variable. More...
 
void vlc_cond_init_daytime (vlc_cond_t *p_condvar)
 Initializes a condition variable (wall clock). More...
 
void vlc_cond_destroy (vlc_cond_t *p_condvar)
 Deinitializes a condition variable. More...
 
void vlc_cond_signal (vlc_cond_t *p_condvar)
 Wakes up one thread waiting on a condition variable. More...
 
void vlc_cond_broadcast (vlc_cond_t *p_condvar)
 Wakes up all threads waiting on a condition variable. More...
 
static int vlc_cond_wait_common (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex, ULONG ulTimeout)
 
void vlc_cond_wait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex)
 Waits on a condition variable. More...
 
int vlc_cond_timedwait (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex, vlc_tick_t deadline)
 Waits on a condition variable up to a certain date. More...
 
int vlc_cond_timedwait_daytime (vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex, time_t deadline)
 
int vlc_threadvar_create (vlc_threadvar_t *p_tls, 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 void vlc_thread_cleanup (struct vlc_thread *th)
 
static void vlc_entry (void *p)
 
static int vlc_clone_attr (vlc_thread_t *p_handle, bool detached, void *(*entry)(void *), void *data, int priority)
 
int vlc_clone (vlc_thread_t *p_handle, 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...
 
int vlc_clone_detach (vlc_thread_t *p_handle, void *(*entry)(void *), void *data, int priority)
 
int vlc_set_priority (vlc_thread_t th, int priority)
 
vlc_thread_t vlc_thread_self (void)
 Thread handle. More...
 
unsigned long vlc_thread_id (void)
 Thread identifier. More...
 
void vlc_cancel (vlc_thread_t thread_id)
 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...
 
void vlc_control_cancel (int cmd,...)
 Internal handler for thread cancellation. More...
 
static int vlc_select (int nfds, fd_set *rdset, fd_set *wrset, fd_set *exset, struct timeval *timeout)
 
 __declspec (dllexport)
 
vlc_tick_t mdate (void)
 Precision monotonic clock. More...
 
void mwait (vlc_tick_t deadline)
 Waits until a deadline. More...
 
void msleep (vlc_tick_t delay)
 Waits for an interval of time. More...
 
static void vlc_timer_do (void *arg)
 
int vlc_timer_create (vlc_timer_t *id, void(*func)(void *), void *data)
 Initializes an asynchronous timer. More...
 
void vlc_timer_destroy (vlc_timer_t timer)
 Destroys an initialized timer. More...
 
void vlc_timer_schedule (vlc_timer_t timer, bool absolute, vlc_tick_t value, vlc_tick_t interval)
 Arms or disarms an initialized timer. More...
 
unsigned vlc_timer_getoverrun (vlc_timer_t timer)
 Fetches and resets the overrun counter for a timer. More...
 
unsigned vlc_GetCPUCount (void)
 Count CPUs. More...
 

Variables

static vlc_threadvar_t thread_key
 
static vlc_mutex_t super_mutex
 
static vlc_cond_t super_variable
 
vlc_rwlock_t config_lock
 
static vlc_static_cond_tstatic_condvar_start = NULL
 
struct vlc_threadvarvlc_threadvar_last = NULL
 

Macro Definition Documentation

◆ Q2LL

#define Q2LL (   q)    ( *( long long * )&( q ))

Typedef Documentation

◆ vlc_static_cond_t

Function Documentation

◆ __declspec()

__declspec ( dllexport  )

◆ _CRT_init()

int _CRT_init ( void  )

Referenced by _DLL_InitTerm().

◆ _CRT_term()

void _CRT_term ( void  )

Referenced by _DLL_InitTerm().

◆ _DLL_InitTerm()

unsigned long _System _DLL_InitTerm ( unsigned long  hmod,
unsigned long  flag 
)

◆ vlc_cancel_self()

static void vlc_cancel_self ( PVOID  dummy)
static

References vlc_thread::killed, and likely.

Referenced by vlc_DosWaitEventSemEx(), and vlc_testcancel().

◆ vlc_clone_attr()

static int vlc_clone_attr ( vlc_thread_t p_handle,
bool  detached,
void *(*)(void *)  entry,
void *  data,
int  priority 
)
static

◆ vlc_clone_detach()

int vlc_clone_detach ( vlc_thread_t p_handle,
void *(*)(void *)  entry,
void *  data,
int  priority 
)

◆ vlc_cond_wait_common()

static int vlc_cond_wait_common ( vlc_cond_t p_condvar,
vlc_mutex_t p_mutex,
ULONG  ulTimeout 
)
static

◆ vlc_DosWaitEventSemEx()

static ULONG vlc_DosWaitEventSemEx ( HEV  hev,
ULONG  ulTimeout 
)
static

◆ vlc_entry()

static void vlc_entry ( void *  p)
static

◆ vlc_select()

static int vlc_select ( int  nfds,
fd_set *  rdset,
fd_set *  wrset,
fd_set *  exset,
struct timeval *  timeout 
)
static

◆ vlc_set_priority()

int vlc_set_priority ( vlc_thread_t  th,
int  priority 
)

< Unspecified error

< No error

References VLC_EGENERIC, and VLC_SUCCESS.

◆ vlc_Sleep()

static ULONG vlc_Sleep ( ULONG  ulTimeout)
static

References vlc_DosWaitEventSemEx().

Referenced by mwait().

◆ vlc_static_cond_destroy_all()

static void vlc_static_cond_destroy_all ( void  )
static

◆ vlc_static_cond_init()

static void vlc_static_cond_init ( vlc_cond_t p_condvar)
static

◆ vlc_thread_cleanup()

static void vlc_thread_cleanup ( struct vlc_thread th)
static

◆ vlc_threads_setup()

void vlc_threads_setup ( libvlc_int_t p_libvlc)

◆ vlc_timer_do()

static void vlc_timer_do ( void *  arg)
static

◆ vlc_WaitForSingleObject()

static ULONG vlc_WaitForSingleObject ( HEV  hev,
ULONG  ulTimeout 
)
static

Variable Documentation

◆ config_lock

vlc_rwlock_t config_lock

Referenced by _DLL_InitTerm(), and DllMain().

◆ static_condvar_start

vlc_static_cond_t* static_condvar_start = NULL
static

◆ super_mutex

vlc_mutex_t super_mutex
static

◆ super_variable

vlc_cond_t super_variable
static

◆ thread_key

vlc_threadvar_t thread_key
static

◆ vlc_threadvar_last

struct vlc_threadvar * vlc_threadvar_last = NULL