FFmpeg
Data Structures | Macros | Typedefs | Functions
w32pthreads.h File Reference
#include <windows.h>
#include <process.h>
#include <time.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_CANCEL_ENABLE   1
 
#define PTHREAD_CANCEL_DISABLE   0
 
#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_timedwait (pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime)
 
static int pthread_cond_signal (pthread_cond_t *cond)
 
static int pthread_setcancelstate (int state, int *oldstate)
 

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 60 of file w32pthreads.h.

◆ PTHREAD_COND_INITIALIZER

#define PTHREAD_COND_INITIALIZER   CONDITION_VARIABLE_INIT

Definition at line 61 of file w32pthreads.h.

◆ InitializeCriticalSection

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

Definition at line 63 of file w32pthreads.h.

◆ WaitForSingleObject

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

Definition at line 64 of file w32pthreads.h.

◆ PTHREAD_CANCEL_ENABLE

#define PTHREAD_CANCEL_ENABLE   1

Definition at line 66 of file w32pthreads.h.

◆ PTHREAD_CANCEL_DISABLE

#define PTHREAD_CANCEL_DISABLE   0

Definition at line 67 of file w32pthreads.h.

◆ PTHREAD_ONCE_INIT

#define PTHREAD_ONCE_INIT   INIT_ONCE_STATIC_INIT

Definition at line 128 of file w32pthreads.h.

Typedef Documentation

◆ pthread_mutex_t

typedef SRWLOCK pthread_mutex_t

Definition at line 57 of file w32pthreads.h.

◆ pthread_cond_t

typedef CONDITION_VARIABLE pthread_cond_t

Definition at line 58 of file w32pthreads.h.

◆ pthread_once_t

Definition at line 127 of file w32pthreads.h.

Function Documentation

◆ win32thread_worker()

static av_unused unsigned __stdcall attribute_align_arg win32thread_worker ( void *  arg)
static

Definition at line 69 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 76 of file w32pthreads.h.

◆ pthread_join()

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

Definition at line 91 of file w32pthreads.h.

◆ pthread_mutex_init()

static int pthread_mutex_init ( pthread_mutex_t m,
void *  attr 
)
inlinestatic

Definition at line 106 of file w32pthreads.h.

◆ pthread_mutex_destroy()

static int pthread_mutex_destroy ( pthread_mutex_t m)
inlinestatic

Definition at line 111 of file w32pthreads.h.

◆ pthread_mutex_lock()

static int pthread_mutex_lock ( pthread_mutex_t m)
inlinestatic

Definition at line 116 of file w32pthreads.h.

◆ pthread_mutex_unlock()

static int pthread_mutex_unlock ( pthread_mutex_t m)
inlinestatic

Definition at line 121 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 130 of file w32pthreads.h.

◆ pthread_cond_init()

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

Definition at line 140 of file w32pthreads.h.

◆ pthread_cond_destroy()

static int pthread_cond_destroy ( pthread_cond_t cond)
inlinestatic

Definition at line 147 of file w32pthreads.h.

◆ pthread_cond_broadcast()

static int pthread_cond_broadcast ( pthread_cond_t cond)
inlinestatic

Definition at line 152 of file w32pthreads.h.

◆ pthread_cond_wait()

static int pthread_cond_wait ( pthread_cond_t cond,
pthread_mutex_t mutex 
)
inlinestatic

Definition at line 158 of file w32pthreads.h.

◆ pthread_cond_timedwait()

static int pthread_cond_timedwait ( pthread_cond_t cond,
pthread_mutex_t mutex,
const struct timespec *  abstime 
)
inlinestatic

Definition at line 164 of file w32pthreads.h.

◆ pthread_cond_signal()

static int pthread_cond_signal ( pthread_cond_t cond)
inlinestatic

Definition at line 180 of file w32pthreads.h.

◆ pthread_setcancelstate()

static int pthread_setcancelstate ( int  state,
int oldstate 
)
inlinestatic

Definition at line 186 of file w32pthreads.h.