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

Data Structures

struct  vlc_thread
 
struct  vlc_threadvar
 

Macros

#define _DECL_DLLMAIN
 
#define IS_INTERRUPTIBLE   (!VLC_WINSTORE_APP || _WIN32_WINNT >= 0x0A00)
 
#define ABOVE_NORMAL_PRIORITY_CLASS   0x00008000
 
#define LOOKUP(s)   (((s##_) = (void *)GetProcAddress(h, #s)) != NULL)
 

Functions

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...
 
static void vlc_threadvars_cleanup (void)
 
void vlc_atomic_wait (void *addr, unsigned val)
 Waits on an address. More...
 
int vlc_atomic_timedwait (void *addr, unsigned val, vlc_tick_t deadline)
 Waits on an address with a time-out. More...
 
int vlc_atomic_timedwait_daytime (void *addr, unsigned val, 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...
 
static unsigned __stdcall vlc_entry (void *p)
 
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...
 
unsigned long vlc_thread_id (void)
 Thread identifier. More...
 
int vlc_set_priority (vlc_thread_t th, int priority)
 
static void CALLBACK vlc_cancel_self (ULONG_PTR self)
 
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...
 
void vlc_control_cancel (vlc_cleanup_t *cleaner)
 Internal handler for thread cancellation. More...
 
void vlc_cancel_addr_set (atomic_uint *addr)
 
void vlc_cancel_addr_clear (atomic_uint *addr)
 
static vlc_tick_t mdate_interrupt (void)
 
static vlc_tick_t mdate_tick (void)
 
static vlc_tick_t mdate_multimedia (void)
 
static vlc_tick_t mdate_perf (void)
 
static vlc_tick_t mdate_wall (void)
 
static vlc_tick_t mdate_default (void)
 
vlc_tick_t vlc_tick_now (void)
 Precision monotonic clock. More...
 
static BOOL SelectClockSource (vlc_object_t *obj)
 
unsigned vlc_GetCPUCount (void)
 Count CPUs. More...
 
void vlc_threads_setup (libvlc_int_t *vlc)
 
BOOL WINAPI DllMain (HANDLE hinstDll, DWORD fdwReason, LPVOID lpvReserved)
 

Variables

static CRITICAL_SECTION super_mutex
 
static CONDITION_VARIABLE super_variable
 
static DWORD thread_key
 
struct vlc_threadvarvlc_threadvar_last = NULL
 
union {
   struct {
      LARGE_INTEGER   freq
 
   }   perf
 
   struct {
      UINT   cbtc
 
   }   multimedia
 
clk
 
static vlc_tick_t(* mdate_selected )(void) = mdate_default
 
static CRITICAL_SECTION setup_lock
 

Macro Definition Documentation

◆ _DECL_DLLMAIN

#define _DECL_DLLMAIN

◆ ABOVE_NORMAL_PRIORITY_CLASS

#define ABOVE_NORMAL_PRIORITY_CLASS   0x00008000

◆ IS_INTERRUPTIBLE

#define IS_INTERRUPTIBLE   (!VLC_WINSTORE_APP || _WIN32_WINNT >= 0x0A00)

◆ LOOKUP

#define LOOKUP (   s)    (((s##_) = (void *)GetProcAddress(h, #s)) != NULL)

Function Documentation

◆ DllMain()

BOOL WINAPI DllMain ( HANDLE  hinstDll,
DWORD  fdwReason,
LPVOID  lpvReserved 
)

◆ mdate_default()

static vlc_tick_t mdate_default ( void  )
static

References mdate_perf(), and vlc_threads_setup().

Referenced by vlc_threads_setup().

◆ mdate_interrupt()

static vlc_tick_t mdate_interrupt ( void  )
static

References CLOCK_FREQ, static_assert, and unlikely.

Referenced by SelectClockSource().

◆ mdate_multimedia()

static vlc_tick_t mdate_multimedia ( void  )
static

◆ mdate_perf()

static vlc_tick_t mdate_perf ( void  )
static

References clk, and vlc_tick_from_frac().

Referenced by mdate_default(), and SelectClockSource().

◆ mdate_tick()

static vlc_tick_t mdate_tick ( void  )
static

◆ mdate_wall()

static vlc_tick_t mdate_wall ( void  )
static

◆ SelectClockSource()

static BOOL SelectClockSource ( vlc_object_t obj)
static

◆ vlc_cancel_self()

static void CALLBACK vlc_cancel_self ( ULONG_PTR  self)
static

Referenced by vlc_cancel().

◆ vlc_entry()

static unsigned __stdcall vlc_entry ( void *  p)
static

◆ vlc_set_priority()

int vlc_set_priority ( vlc_thread_t  th,
int  priority 
)

References VLC_EGENERIC, and VLC_SUCCESS.

◆ vlc_threads_setup()

void vlc_threads_setup ( libvlc_int_t vlc)

◆ vlc_threadvars_cleanup()

static void vlc_threadvars_cleanup ( void  )
static

Variable Documentation

◆ cbtc

UINT cbtc

◆ clk

union { ... } clk

◆ freq

LARGE_INTEGER freq

Referenced by rtp_queue(), and vlc_tick_now().

◆ mdate_selected

vlc_tick_t(* mdate_selected) (void) = mdate_default
static

◆ multimedia

struct { ... } multimedia

◆ perf

struct { ... } perf

Referenced by SelectClockSource().

◆ setup_lock

CRITICAL_SECTION setup_lock
static

Referenced by DllMain(), and vlc_threads_setup().

◆ super_mutex

CRITICAL_SECTION super_mutex
static

◆ super_variable

CONDITION_VARIABLE super_variable
static

Referenced by DllMain().

◆ thread_key

DWORD thread_key
static

◆ vlc_threadvar_last

struct vlc_threadvar * vlc_threadvar_last = NULL