FFmpeg  4.0
Data Structures | Macros | Typedefs | Functions
w32pthreads.h File Reference

w32threads to pthreads wrapper More...

#include <windows.h>
#include <process.h>
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/mem.h"

Go to the source code of this file.

Data Structures

struct  pthread_t
 

Macros

#define WIN32_LEAN_AND_MEAN
 
#define PTHREAD_MUTEX_INITIALIZER   SRWLOCK_INIT
 
#define PTHREAD_COND_INITIALIZER   CONDITION_VARIABLE_INIT
 
#define InitializeCriticalSection(x)   InitializeCriticalSectionEx(x, 0, 0)
 
#define WaitForSingleObject(a, b)   WaitForSingleObjectEx(a, b, FALSE)
 
#define PTHREAD_ONCE_INIT   INIT_ONCE_STATIC_INIT
 

Typedefs

typedef SRWLOCK pthread_mutex_t
 
typedef CONDITION_VARIABLE pthread_cond_t
 
typedef INIT_ONCE pthread_once_t
 

Functions

static av_unused unsigned __stdcall attribute_align_arg win32thread_worker (void *arg)
 
static av_unused int pthread_create (pthread_t *thread, const void *unused_attr, void *(*start_routine)(void *), void *arg)
 
static av_unused int pthread_join (pthread_t thread, void **value_ptr)
 
static int pthread_mutex_init (pthread_mutex_t *m, void *attr)
 
static int pthread_mutex_destroy (pthread_mutex_t *m)
 
static int pthread_mutex_lock (pthread_mutex_t *m)
 
static int pthread_mutex_unlock (pthread_mutex_t *m)
 
static av_unused int pthread_once (pthread_once_t *once_control, void(*init_routine)(void))
 
static int pthread_cond_init (pthread_cond_t *cond, const void *unused_attr)
 
static int pthread_cond_destroy (pthread_cond_t *cond)
 
static int pthread_cond_broadcast (pthread_cond_t *cond)
 
static int pthread_cond_wait (pthread_cond_t *cond, pthread_mutex_t *mutex)
 
static int pthread_cond_signal (pthread_cond_t *cond)
 

Detailed Description

w32threads to pthreads wrapper

Definition in file w32pthreads.h.

Macro Definition Documentation

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 38 of file w32pthreads.h.

◆ PTHREAD_MUTEX_INITIALIZER

#define PTHREAD_MUTEX_INITIALIZER   SRWLOCK_INIT

Definition at line 58 of file w32pthreads.h.

◆ PTHREAD_COND_INITIALIZER

#define PTHREAD_COND_INITIALIZER   CONDITION_VARIABLE_INIT

Definition at line 59 of file w32pthreads.h.

◆ InitializeCriticalSection

#define InitializeCriticalSection (   x)    InitializeCriticalSectionEx(x, 0, 0)

Definition at line 61 of file w32pthreads.h.

◆ WaitForSingleObject

#define WaitForSingleObject (   a,
  b 
)    WaitForSingleObjectEx(a, b, FALSE)

◆ PTHREAD_ONCE_INIT

#define PTHREAD_ONCE_INIT   INIT_ONCE_STATIC_INIT

Definition at line 123 of file w32pthreads.h.

Typedef Documentation

◆ pthread_mutex_t

typedef SRWLOCK pthread_mutex_t

Definition at line 55 of file w32pthreads.h.

◆ pthread_cond_t

typedef CONDITION_VARIABLE pthread_cond_t

Definition at line 56 of file w32pthreads.h.

◆ pthread_once_t

typedef INIT_ONCE pthread_once_t

Definition at line 122 of file w32pthreads.h.

Function Documentation

◆ win32thread_worker()

static av_unused unsigned __stdcall attribute_align_arg win32thread_worker ( void arg)
static

Definition at line 64 of file w32pthreads.h.

Referenced by pthread_create().

◆ pthread_create()

static av_unused int pthread_create ( pthread_t thread,
const void unused_attr,
void *(*)(void *)  start_routine,
void arg 
)
static

Definition at line 71 of file w32pthreads.h.

◆ pthread_join()

static av_unused int pthread_join ( pthread_t  thread,
void **  value_ptr 
)
static

Definition at line 86 of file w32pthreads.h.

◆ pthread_mutex_init()

static int pthread_mutex_init ( pthread_mutex_t m,
void attr 
)
inlinestatic

Definition at line 101 of file w32pthreads.h.

◆ pthread_mutex_destroy()

static int pthread_mutex_destroy ( pthread_mutex_t m)
inlinestatic

Definition at line 106 of file w32pthreads.h.

◆ pthread_mutex_lock()

static int pthread_mutex_lock ( pthread_mutex_t m)
inlinestatic

Definition at line 111 of file w32pthreads.h.

◆ pthread_mutex_unlock()

static int pthread_mutex_unlock ( pthread_mutex_t m)
inlinestatic

Definition at line 116 of file w32pthreads.h.

◆ pthread_once()

static av_unused int pthread_once ( pthread_once_t once_control,
void(*)(void init_routine 
)
static

Definition at line 125 of file w32pthreads.h.

◆ pthread_cond_init()

static int pthread_cond_init ( pthread_cond_t cond,
const void unused_attr 
)
inlinestatic

Definition at line 135 of file w32pthreads.h.

◆ pthread_cond_destroy()

static int pthread_cond_destroy ( pthread_cond_t cond)
inlinestatic

Definition at line 142 of file w32pthreads.h.

◆ pthread_cond_broadcast()

static int pthread_cond_broadcast ( pthread_cond_t cond)
inlinestatic

Definition at line 147 of file w32pthreads.h.

◆ pthread_cond_wait()

static int pthread_cond_wait ( pthread_cond_t cond,
pthread_mutex_t mutex 
)
inlinestatic

Definition at line 153 of file w32pthreads.h.

◆ pthread_cond_signal()

static int pthread_cond_signal ( pthread_cond_t cond)
inlinestatic

Definition at line 159 of file w32pthreads.h.