26 #ifndef AVCODEC_OS2PTHREADS_H
27 #define AVCODEC_OS2PTHREADS_H
32 #undef __STRICT_ANSI__
49 void *(*start_routine)(
void *);
66 thread_arg =
av_mallocz(
sizeof(
struct thread_arg));
71 *thread = _beginthread(
thread_entry, NULL, 256 * 1024, thread_arg);
78 DosWaitThread((PTID)&thread, DCWW_WAIT);
85 DosCreateMutexSem(NULL, (PHMTX)mutex, 0,
FALSE);
92 DosCloseMutexSem(*(PHMTX)mutex);
99 DosRequestMutexSem(*(PHMTX)mutex, SEM_INDEFINITE_WAIT);
106 DosReleaseMutexSem(*(PHMTX)mutex);
155 DosWaitEventSem(cond->
event_sem, SEM_INDEFINITE_WAIT);
static av_always_inline int pthread_mutex_destroy(pthread_mutex_t *mutex)
static void thread_entry(void *arg)
static av_always_inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
static av_always_inline int pthread_cond_destroy(pthread_cond_t *cond)
void *(* start_routine)(void *)
static av_always_inline int pthread_cond_signal(pthread_cond_t *cond)
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
static av_always_inline int pthread_join(pthread_t thread, void **value_ptr)
static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
static pthread_mutex_t * mutex
static av_always_inline int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
static av_always_inline int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
static av_always_inline int pthread_cond_broadcast(pthread_cond_t *cond)
static av_always_inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
static av_always_inline int pthread_mutex_lock(pthread_mutex_t *mutex)
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...