summaryrefslogtreecommitdiffstats
path: root/compat
diff options
context:
space:
mode:
authorKO Myung-Hun <komh78@gmail.com>2017-12-28 22:03:56 +0900
committerJames Almer <jamrial@gmail.com>2018-01-07 00:14:12 -0300
commit3c0a081a1e9fc4101252af0aeb6be020ecda43ed (patch)
tree66bf5c2ef8b670e2a6976ba4244d4c2c0a44e10e /compat
parentd03c39b46b21c893d6549a532289b7fb9935b3fc (diff)
downloadffmpeg-streaming-3c0a081a1e9fc4101252af0aeb6be020ecda43ed.zip
ffmpeg-streaming-3c0a081a1e9fc4101252af0aeb6be020ecda43ed.tar.gz
compat/os2threads: support static mutexes
Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'compat')
-rw-r--r--compat/os2threads.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/compat/os2threads.h b/compat/os2threads.h
index 40a119f..2177a03 100644
--- a/compat/os2threads.h
+++ b/compat/os2threads.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 KO Myung-Hun <komh@chollian.net>
+ * Copyright (c) 2011-2017 KO Myung-Hun <komh@chollian.net>
*
* This file is part of FFmpeg.
*
@@ -46,9 +46,11 @@ typedef struct {
typedef void pthread_attr_t;
-typedef HMTX pthread_mutex_t;
+typedef _fmutex pthread_mutex_t;
typedef void pthread_mutexattr_t;
+#define PTHREAD_MUTEX_INITIALIZER _FMUTEX_INITIALIZER
+
typedef struct {
HEV event_sem;
HEV ack_sem;
@@ -98,28 +100,28 @@ 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)
{
- DosCreateMutexSem(NULL, (PHMTX)mutex, 0, FALSE);
+ _fmutex_create(mutex, 0);
return 0;
}
static av_always_inline int pthread_mutex_destroy(pthread_mutex_t *mutex)
{
- DosCloseMutexSem(*(PHMTX)mutex);
+ _fmutex_close(mutex);
return 0;
}
static av_always_inline int pthread_mutex_lock(pthread_mutex_t *mutex)
{
- DosRequestMutexSem(*(PHMTX)mutex, SEM_INDEFINITE_WAIT);
+ _fmutex_request(mutex, 0);
return 0;
}
static av_always_inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
{
- DosReleaseMutexSem(*(PHMTX)mutex);
+ _fmutex_release(mutex);
return 0;
}
OpenPOWER on IntegriCloud