29 #ifndef COMPAT_W32PTHREADS_H
30 #define COMPAT_W32PTHREADS_H
38 #define WIN32_LEAN_AND_MEAN
49 void *(*func)(
void*
arg);
58 #define PTHREAD_MUTEX_INITIALIZER SRWLOCK_INIT
59 #define PTHREAD_COND_INITIALIZER CONDITION_VARIABLE_INIT
61 #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
62 #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
72 void *(*start_routine)(
void*),
void *
arg)
74 thread->
func = start_routine;
89 if (ret != WAIT_OBJECT_0) {
90 if (ret == WAIT_ABANDONED)
96 *value_ptr = thread.
ret;
97 CloseHandle(thread.
handle);
103 InitializeSRWLock(m);
113 AcquireSRWLockExclusive(m);
118 ReleaseSRWLockExclusive(m);
123 #define PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT
128 InitOnceBeginInitialize(once_control, 0, &pending,
NULL);
131 InitOnceComplete(once_control, 0,
NULL);
137 InitializeConditionVariable(cond);
149 WakeAllConditionVariable(cond);
155 SleepConditionVariableSRW(cond, mutex, INFINITE, 0);
161 WakeConditionVariable(cond);
static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
#define WaitForSingleObject(a, b)
CONDITION_VARIABLE pthread_cond_t
static av_unused unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
Memory handling functions.
Macro definitions for various function/variable attributes.
static int pthread_cond_destroy(pthread_cond_t *cond)
int(* cond)(enum AVPixelFormat pix_fmt)
static av_unused int pthread_create(pthread_t *thread, const void *unused_attr, void *(*start_routine)(void *), void *arg)
static int pthread_mutex_init(pthread_mutex_t *m, void *attr)
void *(* func)(void *arg)
static int pthread_mutex_unlock(pthread_mutex_t *m)
common internal API header
static int pthread_mutex_destroy(pthread_mutex_t *m)
static int pthread_cond_signal(pthread_cond_t *cond)
static int pthread_mutex_lock(pthread_mutex_t *m)
static av_unused int pthread_once(pthread_once_t *once_control, void(*init_routine)(void))
static int pthread_cond_broadcast(pthread_cond_t *cond)
static av_unused int pthread_join(pthread_t thread, void **value_ptr)
common internal and external API header
static int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)