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 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 THREADFUNC_RETTYPE   unsigned
 
#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 THREADFUNC_RETTYPE __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

◆ PTHREAD_MUTEX_INITIALIZER

#define PTHREAD_MUTEX_INITIALIZER   SRWLOCK_INIT

Definition at line 59 of file w32pthreads.h.

◆ PTHREAD_COND_INITIALIZER

#define PTHREAD_COND_INITIALIZER   CONDITION_VARIABLE_INIT

Definition at line 60 of file w32pthreads.h.

◆ InitializeCriticalSection

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

Definition at line 62 of file w32pthreads.h.

◆ WaitForSingleObject

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

Definition at line 63 of file w32pthreads.h.

◆ PTHREAD_CANCEL_ENABLE

#define PTHREAD_CANCEL_ENABLE   1

Definition at line 65 of file w32pthreads.h.

◆ PTHREAD_CANCEL_DISABLE

#define PTHREAD_CANCEL_DISABLE   0

Definition at line 66 of file w32pthreads.h.

◆ THREADFUNC_RETTYPE

#define THREADFUNC_RETTYPE   unsigned

Definition at line 71 of file w32pthreads.h.

◆ PTHREAD_ONCE_INIT

#define PTHREAD_ONCE_INIT   INIT_ONCE_STATIC_INIT

Definition at line 149 of file w32pthreads.h.

Typedef Documentation

◆ pthread_mutex_t

typedef SRWLOCK pthread_mutex_t

Definition at line 56 of file w32pthreads.h.

◆ pthread_cond_t

typedef CONDITION_VARIABLE pthread_cond_t

Definition at line 57 of file w32pthreads.h.

◆ pthread_once_t

Definition at line 148 of file w32pthreads.h.

Function Documentation

◆ win32thread_worker()

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

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

◆ pthread_join()

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

Definition at line 111 of file w32pthreads.h.

◆ pthread_mutex_init()

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

Definition at line 127 of file w32pthreads.h.

◆ pthread_mutex_destroy()

static int pthread_mutex_destroy ( pthread_mutex_t m)
inlinestatic

Definition at line 132 of file w32pthreads.h.

◆ pthread_mutex_lock()

static int pthread_mutex_lock ( pthread_mutex_t m)
inlinestatic

Definition at line 137 of file w32pthreads.h.

◆ pthread_mutex_unlock()

static int pthread_mutex_unlock ( pthread_mutex_t m)
inlinestatic

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

◆ pthread_cond_init()

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

Definition at line 161 of file w32pthreads.h.

◆ pthread_cond_destroy()

static int pthread_cond_destroy ( pthread_cond_t cond)
inlinestatic

Definition at line 168 of file w32pthreads.h.

◆ pthread_cond_broadcast()

static int pthread_cond_broadcast ( pthread_cond_t cond)
inlinestatic

Definition at line 173 of file w32pthreads.h.

◆ pthread_cond_wait()

static int pthread_cond_wait ( pthread_cond_t cond,
pthread_mutex_t mutex 
)
inlinestatic

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

◆ pthread_cond_signal()

static int pthread_cond_signal ( pthread_cond_t cond)
inlinestatic

Definition at line 201 of file w32pthreads.h.

◆ pthread_setcancelstate()

static int pthread_setcancelstate ( int  state,
int *  oldstate 
)
inlinestatic

Definition at line 207 of file w32pthreads.h.